setobslabel(series) order of events

For questions regarding programming in the EViews programming language.

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

bhaupt
Posts: 25
Joined: Fri May 07, 2010 1:16 pm

setobslabel(series) order of events

Postby bhaupt » Tue Feb 01, 2011 3:27 pm

I am using the latest build of eviews 7.1.

I want to use an alpha series in place of my date series along the bottom axis. If I build the graph through the menus and options, it works properly; however, if I try to use te setobslabel in my code it seems to not work.

I assume I have a contradictory statement or something that overrides my alphaseries and forces it to the date series.

As such, I have included all subsequent graph commands for inspection.


Code: Select all

for %ser FOO BAR
group g_{%ser}_gph1 {%ser}_exmpl_sa {%ser}_exmpl_tr mean_exmpl_sa mean_exmpl_tr
graph gr_{%ser}_gph1.line(x) g_{%ser}_gph1

' Here's the setobslabel command
gr_{%ser}_gph1.setobslabel(series) alp_yr_name
gr_{%ser}_gph1.axis(l) textcolor(black) overlap units(k)  font("ariel",10,b)   range(0,!testmax1)
gr_{%ser}_gph1.axis(b) textcolor(black)  font("ariel",10,b)
gr_{%ser}_gph1.setupdate(a)
gr_{%ser}_gph1.addtext(t, textcolor(black),font("ariel",8,b)) %titlestring
gr_{%ser}_gph1.addtext(l, textcolor(black), font("ariel",10,b) )   "My Units (K, SA)"
gr_{%ser}_gph1.addtext(b, textcolor(black),font("ariel",10,b)) "Normalized Monthly Data"
gr_{%ser}_gph1.legend -display
gr_{%ser}_gph1.options linepat
gr_{%ser}_gph1.setelem(1) lcolor(black) lpat(1) axis(l)
gr_{%ser}_gph1.setelem(2) lcolor(blue) lpat(1) axis(l)
gr_{%ser}_gph1.setelem(3) lcolor(black) lpat(2) axis(l)
gr_{%ser}_gph1.setelem(4) lcolor(blue) lpat(2) axis(l)
next

EViews Pamela
EViews Developer
Posts: 54
Joined: Wed Sep 17, 2008 2:52 pm

Re: setobslabel(series) order of events

Postby EViews Pamela » Tue Feb 01, 2011 4:51 pm

You are correct that it is an ordering issue. The setupdate command changes the fundamental behavior of a graph. I would suggest calling it before setting other attributres such as color, labels, etc.

bhaupt
Posts: 25
Joined: Fri May 07, 2010 1:16 pm

Re: setobslabel(series) order of events

Postby bhaupt » Wed Feb 02, 2011 7:16 am

Thanks - that was exactly it.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 68 guests