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).
Format zeroline
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: Format zeroline
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.
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.
-
- Posts: 15
- Joined: Wed Mar 20, 2013 7:14 am
Re: Format zeroline
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?
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: Format zeroline
Here is an example
NOTE: you will need EViews 9
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)
-
- Posts: 8
- Joined: Mon Jul 17, 2017 3:49 am
Re: Format zeroline
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.
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.
-
- Posts: 540
- Joined: Fri Apr 15, 2011 5:35 am
Re: Format zeroline
Gareth, any thoughts?
t
t
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: Format zeroline
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.
We will get it fixed in the next patch.
Who is online
Users browsing this forum: No registered users and 31 guests