Page 1 of 2
More graph programming questions
Posted: Wed Apr 02, 2014 4:05 am
by barteph
How do I program so that the series in a line graph are renamed?
For instance, if I have F_VA, G_VA and I want these to show up in ledgend as "France Value Added" and "Germany Value Added"
How would I program a graph with 2 axes, where one of the axes is inverted?
say for instance, I have F_CAPEX and EU_UNCERTAINTY, France Capex and the EU uncertainty index. I want the EU uncertainty index to show up on an axes that is inverted.
Many thanks
Re: More graph programming questions
Posted: Wed Apr 02, 2014 10:13 am
by EViews Jason
Use:
Code: Select all
mygraph.name(1) France Value Added
mygraph.name(2) Germany Value Added
To answer the second part, you will have to put the second series on the right axis and then invert it
Code: Select all
mygraph.setelem(2) axis(r)
mygraph.axis(right) invert
Re: More graph programming questions
Posted: Thu Apr 03, 2014 4:52 am
by barteph
Thanks so much Jason!
How would I program it to give the graph a name say "Value-Added Investment" ?
Finally if I have number of countries for the series how would I do this as a loop
Other then
show VA_France.Line
show VA_Germany.LIne
show VA_Spain.Line
show VA_Greece.Line
and then the freeze command with each of them.
etc
Re: More graph programming questions
Posted: Thu Apr 03, 2014 8:42 am
by EViews Jason
How would I program it to give the graph a name say "Value-Added Investment" ?
Code: Select all
mygraph.text(t) Value-Added Investment
Finally if I have number of countries for the series how would I do this as a loop
Other then
show VA_France.Line
show VA_Germany.LIne
show VA_Spain.Line
show VA_Greece.Line
and then the freeze command with each of them.
etc
Code: Select all
for %s VA_France VA_Germany
freeze({%s}_graph) {%s}.line
next
Re: More graph programming questions
Posted: Thu Apr 03, 2014 3:32 pm
by barteph
Sorry I meant to ask how you would loop the renaming of a series in a graph. So I have VA_graph.line.
How would I loop it so that I can rename all the series in the graph?
VA_graph.name(1) France
VA_graph.name(2) Germany
VA_graph.name(3) Italy
VA_graph.name(4) Spain
VA_graph.name(5) Euro Area
VA_graph.name(6) UK
I would also like to add % to the y axis title. How do I program so that axes are labeled.
Thanks
Re: More graph programming questions
Posted: Thu Apr 03, 2014 5:50 pm
by barteph
With regards to above.
mygraph.setelem(2) axis(r)
mygraph.axis(right) invert
What if I wanted the right inverted axis to start at a certain value?
Re: More graph programming questions
Posted: Thu Apr 03, 2014 7:38 pm
by EViews Gareth
All of these commands are listed in the graph section of the Object Reference pdf
Re: More graph programming questions
Posted: Fri Apr 04, 2014 7:00 am
by barteph
where is this pdf or can you send a copy?
Re: More graph programming questions
Posted: Fri Apr 04, 2014 7:15 am
by EViews Gareth
Help menu
Re: More graph programming questions
Posted: Fri Apr 04, 2014 8:05 am
by barteph
I don't see what I want to do in here...can you direct me to page(s)
I can't get setobslabel command to work or label y axis.
Re: More graph programming questions
Posted: Fri Apr 04, 2014 8:43 am
by EViews Gareth
How would I loop it so that I can rename all the series in the graph?
VA_graph.name(1) France
VA_graph.name(2) Germany
VA_graph.name(3) Italy
VA_graph.name(4) Spain
VA_graph.name(5) Euro Area
VA_graph.name(6) UK
Thanks
Code: Select all
%names = "France Germany Italy Spain ""Euro Area"" UK"
for !i=1 to 6
va_graph.name(!i) @word(%names, !i)
next
Re: More graph programming questions
Posted: Fri Apr 04, 2014 8:45 am
by EViews Gareth
You want the
and
commands, I think.
Re: More graph programming questions
Posted: Fri Apr 04, 2014 11:09 am
by barteph
Hmm... the loop above doesn't seem to work for me.
Re: More graph programming questions
Posted: Fri Apr 04, 2014 11:20 am
by EViews Gareth
Code: Select all
%name = @word(%names, !i)
va_graph.name(!i) {%name}
Re: More graph programming questions
Posted: Fri Apr 04, 2014 12:41 pm
by barteph
when I use this I just get for each series
@word("France Germany Italy Spain ""Euro Area"" UK", 1)
@word("France Germany Italy Spain ""Euro Area"" UK", 2)
@word("France Germany Italy Spain ""Euro Area"" UK", 3)
@word("France Germany Italy Spain ""Euro Area"" UK", 4)
@word("France Germany Italy Spain ""Euro Area"" UK", 5)
@word("France Germany Italy Spain ""Euro Area"" UK", 6)