Page 1 of 1
Format zeroline
Posted: Sun Jul 26, 2015 3:19 am
by Thomasms90
Is it possible to format the zeroline? Ideally I'd like it in the background in light grey, dashed and 0.25 width.
I can't find any option to do this and tried specififying some parameters after the -dashline parameter in my program, but it doesn't help.
I also tried creating an extra series that's always equal to zero and format that, however that line doesn't fill the whole horizontal area (i.e. doesn't extend to the vertical axis lines).
Re: Format zeroline
Posted: Mon Jul 27, 2015 10:44 am
by EViews Jason
Unfortunately the zero line isn't customizable. I can't think of any workarounds that will go from end to end, be drawn in the background, gray, and .25 pts wide.
The closest thing you could do is draw a gray line 0.25 wide from end to end but it wont be in the background.
Re: Format zeroline
Posted: Mon Jul 27, 2015 10:58 am
by Thomasms90
Okay. It should be okay with a regular line if it's possible to get it from end to end, I just haven't been able to. Can you explain how?
Re: Format zeroline
Posted: Mon Jul 27, 2015 2:42 pm
by EViews Jason
Here is an example
NOTE: you will need EViews 9
Code: Select all
create u 10
series x=rnd-.5
graph g.line x
' note units are in graph virtual inches
!x_9 = g.@axispos(9, "b") ' x pos at observation 9
!x_10 = g.@axispos(10, "b") ' x pos at observation 10
!obsdist = !x_10-!x_9 ' the width of 1 observation
!xmax = !x_10+!obsdist/2 'the x pos of the end of the bottom axis
!yzero = g.@axispos(0, "l") ' y position where the data equals 0
g.addarrow pos(0, !yzero, !xmax, !yzero) linewidth(0.25) color(@rgb(200,200,200)) startsym(none) endsym(none) pattern(2)
Re: Format zeroline
Posted: Sat Sep 05, 2020 2:33 am
by Dag Kolsrud
In a program two series of weekly and quarterly frequency is generated on different pages in the same workfile:
pageselect w
smpl 2007 @now
genr spgrowth = 100*((index_sp500-@elem(index_sp500, "2007"))/@elem(index_sp500, "2007"))
pageselect q
smpl 2007 @now
graph g.line w\spgrowth ((qusa_sa-@elem(qusa_sa, "2007"))/@elem(qusa_sa, "2007"))*100
To draw a zero line in a graph I use (among others) the command
!yzero = g.@axispos(-0.002, "l") ' y position where the data equals 0
which resulted in an error message. Changing the code to
pageselect w
smpl 2007 @now
genr spgrowth = 100*((index_sp500-@elem(index_sp500, "2007"))/@elem(index_sp500, "2007"))
pageselect q
smpl 2007 @now
genr qusagrowth = 100*((qusa_sa-@elem(qusa_sa, "2007"))/@elem(qusa_sa, "2007"))
graph g.line(a) qusagrowth w\spgrowth
so that there is no y-scaling (by *100) in the graph command apparently solved the problem. Is it so that transformations of series in the graph command may ‘confuse’ @axispos and cause an error?
graph-kommandoen laget problemer for y-skal ‘forståelsen’ til @axispos.
Re: Format zeroline
Posted: Tue Sep 22, 2020 12:10 pm
by tvonbrasch
Gareth, any thoughts?
t
Re: Format zeroline
Posted: Tue Sep 22, 2020 1:23 pm
by EViews Jason
There is apparently an issue with @axispos on graphs that use series from another workfile page.
We will get it fixed in the next patch.
Re: Format zeroline
Posted: Tue Sep 22, 2020 9:05 pm
by tvonbrasch
Great, thanks!
t