Page 1 of 2
Label Graph Axis
Posted: Tue Nov 19, 2013 9:42 am
by rmoralesaramburu
Hello,
I need to label the bottom axis of my graph with dates. The dates I want are on an excel file, and are on a row and several columns. How can I program eviews to import does dates and label it on the bottom axis of my graph.
thanks!!
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 9:58 am
by EViews Gareth
What is the graph of? How was it created?
Is there any special reason that the workfile containing the graph doesn't already have dates?
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 11:03 am
by rmoralesaramburu
the graph is a line graph of a series
The workfile contains series, doesn't contain dates. I am importing data from excel with wfopen function
Code: Select all
wfopen(page=ois) "H:\10. Varios\Rodrigo Morales\Analisis\Program Inputs\FI\OIS_US.xlsx" range=sheet1!b8
and the thing is that my series are in columns, column A is series1, column B is series2, .... and so on. but my dates are on a row, so Column A will have a date columnA on row1, column B a date con column B row1, and so on..
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 11:07 am
by EViews Gareth
Could you provide the Excel file?
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 11:34 am
by rmoralesaramburu
Here it is, in row 2 are the dates I need to use.
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 12:18 pm
by EViews Gareth
Problem is that you only have 47 dates (B2:AV2), yet you have 50 observations in the workfile (and thus, I presume, the graph). Where are the missing 3 dates?
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 12:38 pm
by rmoralesaramburu
The thing is I created a new series with 47 observation on Eviews (I extract an observation per column), and I would like to graph them, with the dates on row 2, so I have 47 dates, and 47 observations.
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 12:50 pm
by EViews Gareth
ok, could you provide the workfile with the graph (or the program that makes the graph)?
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 12:56 pm
by rmoralesaramburu
Here it is
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 12:58 pm
by rmoralesaramburu
and the workfile
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 1:05 pm
by EViews Gareth
I'd do something like this:
Code: Select all
wfopen(page=ois) "OIS_US.xlsx" range=sheet1!b8
matrix(47,1) months_to_hike
for !i = 1 to 47
smpl if fwd2013_!i<=0.5
matrix months_to_hike(!i,1)=@obs( fwd2013_!i)
next
pageload(page=dates) "ois_us.xlsx" byrow range=sheet1!b2:av2
alpha dates = @datestr(@date, "DD-MM-YY")
copy ois\months_to_hike dates\
mtos(months_to_hike)
rename ser01 monthshike
graph months.line monthshike
months.addtext(t,font("arial",12,b)) "Months to FED Hike"
save "H:\10. Varios\Rodrigo Morales\Analisis\EVIEWS\OIS_MonthHike.wf1"
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 1:16 pm
by rmoralesaramburu
thanks! just a question, what are you telling the program to do with
Code: Select all
alpha dates = @datestr(@date, "DD-MM-YY")
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 2:14 pm
by EViews Gareth
Oh, that line is not needed, I forgot to remove it.
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 2:48 pm
by rmoralesaramburu
Do you know how to label the last observation in a line graph? I would like to label just the LAST observation.
Thanks!
Re: Label Graph Axis
Posted: Tue Nov 19, 2013 2:51 pm
by EViews Gareth
Code: Select all
wfopen(page=ois) "OIS_US.xlsx" range=sheet1!b8
matrix(47,1) months_to_hike
for !i = 1 to 47
smpl if fwd2013_!i<=0.5
matrix months_to_hike(!i,1)=@obs( fwd2013_!i)
next
pageload(page=dates) "ois_us.xlsx" byrow range=sheet1!b2:av2
smpl @last @last
alpha dates = @datestr(@date, "DD-MM-YY")
smpl @all
copy ois\months_to_hike dates\
mtos(months_to_hike)
rename ser01 monthshike
graph months.line monthshike
months.addtext(t,font("arial",12,b)) "Months to FED Hike"
months.setobslabel(series) dates