Label Graph Axis

For questions regarding programming in the EViews programming language.

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

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 9:42 am

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!!

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

Re: Label Graph Axis

Postby EViews Gareth » Tue Nov 19, 2013 9:58 am

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?

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Re: Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 11:03 am

the graph is a line graph of a series

Code: Select all

graph ois.line xseries
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..

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

Re: Label Graph Axis

Postby EViews Gareth » Tue Nov 19, 2013 11:07 am

Could you provide the Excel file?

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Re: Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 11:34 am

Here it is, in row 2 are the dates I need to use.
Attachments
OIS_US.xlsx
so in row 2 I have the dates I will like
(102.47 KiB) Downloaded 580 times

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

Re: Label Graph Axis

Postby EViews Gareth » Tue Nov 19, 2013 12:18 pm

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?

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Re: Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 12:38 pm

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.

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

Re: Label Graph Axis

Postby EViews Gareth » Tue Nov 19, 2013 12:50 pm

ok, could you provide the workfile with the graph (or the program that makes the graph)?

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Re: Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 12:56 pm

Here it is
Attachments
ois_monthhike.prg
(481 Bytes) Downloaded 599 times

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Re: Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 12:58 pm

and the workfile
Attachments
OIS_MonthHike.wf1
(48.9 KiB) Downloaded 401 times

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

Re: Label Graph Axis

Postby EViews Gareth » Tue Nov 19, 2013 1:05 pm

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"

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Re: Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 1:16 pm

thanks! just a question, what are you telling the program to do with

Code: Select all

alpha dates = @datestr(@date, "DD-MM-YY")

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

Re: Label Graph Axis

Postby EViews Gareth » Tue Nov 19, 2013 2:14 pm

Oh, that line is not needed, I forgot to remove it.

rmoralesaramburu
Posts: 52
Joined: Mon Nov 18, 2013 9:09 am

Re: Label Graph Axis

Postby rmoralesaramburu » Tue Nov 19, 2013 2:48 pm

Do you know how to label the last observation in a line graph? I would like to label just the LAST observation.

Thanks!

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

Re: Label Graph Axis

Postby EViews Gareth » Tue Nov 19, 2013 2:51 pm

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests