Shading in graphs

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Shading in graphs

Postby cap » Wed Dec 31, 2008 9:32 am

Hello,

Sorry if this is too elementary of a question ... suppose I have a variable with 1's during a recession quarter and 0's elsewhere. How can I use this series to shade in recession quarters for some graph?


I have seen in the documentation something like this: " mygraph.draw(shade,bottom) startQ endQ ", but I would like to avoid having to type this in for every beginning and ending period I want shaded...


Thanks in advance,
-cap

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Shading in graphs

Postby EViews Gareth » Wed Dec 31, 2008 9:56 am

Unfortunately we don't have that functionality yet. The only way to do it is one at a time via dates :(
Follow us on Twitter @IHSEViews

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Re: Shading in graphs

Postby cap » Wed Dec 31, 2008 1:27 pm

Oh, ok, well thats too bad. I have written up a little piece of code which will suffice for now, so I guess I will add that to the code depository, and I will certainly re-post this on the wish-list section as well. Here's to a quick release of Eviews 7!


Happy holidays,
-cap





' RECESSION_SHADE.prg - adds shading to all recession quarters
'
'
' EXAMPLE:
'
' run recession_shade graph01
'
' This will add quarterly recession shading to the graph in your workfile named graph01.
'
'
' Note: At the time this program was written, the recession starting in 2007Q4 has not ended. Thus its end date in the program below may be incorrect.
'
' Author: Calvin Price
' First Version: December 31 2008
' Comments: cprice@gmail.com


%mygraph = %0

{%mygraph}.draw(shade,bottom) 1949Q1 1949Q3
{%mygraph}.draw(shade,bottom) 1953Q3 1954Q2
{%mygraph}.draw(shade,bottom) 1957Q4 1958Q1
{%mygraph}.draw(shade,bottom) 1960Q2 1961Q1
{%mygraph}.draw(shade,bottom) 1970Q1 1970Q4
{%mygraph}.draw(shade,bottom) 1973Q4 1975Q1
{%mygraph}.draw(shade,bottom) 1980Q1 1980Q2
{%mygraph}.draw(shade,bottom) 1981Q3 1982Q4
{%mygraph}.draw(shade,bottom) 1990Q3 1991Q1
{%mygraph}.draw(shade,bottom) 2001Q2 2001Q4
{%mygraph}.draw(shade,bottom) 2007Q4 2008Q4


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 37 guests