Code to graph series in multiple frequencies

For questions regarding programming in the EViews programming language.

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

BT454
Posts: 108
Joined: Wed Aug 02, 2017 6:07 am

Code to graph series in multiple frequencies

Hi!
Is there code available to graph series of different frequency types on one graph?
For instance I'd like plot of line graph of daily price data on the right axis, and a bar graph of weekly natural gas data on the left axis, on the same graph.
Thanks!
Bob

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

Re: Code to graph series in multiple frequencies

Code: Select all

`wfcreate(page=q) a 1990 2020series y=rnd*100pagecreate(page=m) m 1990 2020series x=rnd*10copy(link) q\y m\ygroup g  y xfreeze(mygraph) g.linemygraph.setelem(2) axis(r)mygraph.axis overlap   'this is optional depending on your feelingsshow mygraph`

BT454
Posts: 108
Joined: Wed Aug 02, 2017 6:07 am

Re: Code to graph series in multiple frequencies

Thank you very much!
One more question:
How would I make one series a bar, and the other series a line?
Thanks again,
Bob

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

Re: Code to graph series in multiple frequencies

BT454
Posts: 108
Joined: Wed Aug 02, 2017 6:07 am

Re: Code to graph series in multiple frequencies

Thanks,
When I use the code:
freeze(mygraph) g.mixed bar(sdfyinvusl48) line(pnhh)
to create a mixed graph the series I'd like to keep in daily (pnhh) converts to weekly.
Is there a way to use this command and keep the series pnhh as daily frequency, and not convert to weekly?
Here is the full code:
group g sdfyinvusl48 pnhh
freeze(mygraph) g.mixed bar(sdfyinvusl48) line(pnhh)
mygraph.setelem(1) axis(l)
mygraph.setelem(2) axis(r)
mygraph.axis overlap

please note, if i replace the freeze command above with this:
freeze(mygraph) g.line
the pnhh series stays in daily frequency and does not convert to weekly.
Thanks!

EViews Jason
EViews Developer
Posts: 818
Joined: Tue Sep 16, 2008 3:50 pm

Re: Code to graph series in multiple frequencies

Unfortunately with mixed graphs, we do not support mixed frequency plots. We look into possibly adding the feature in the future

Who is online

Users browsing this forum: No registered users and 25 guests