matrix graphs and individual labeling

For questions regarding programming in the EViews programming language.

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

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

matrix graphs and individual labeling

Postby tchaithonov » Mon Jun 06, 2011 3:26 pm

Hi there,

I wonder if there is a way programmatically to label each individual series if I have several columns of data in a matrix and I want to create a line(m) charts. Currently it gives me C1, C2, ... and I notice that there is a way to change individual legends in the gui option, is there one through codes? Please let me know. Thanks.

Tchaithonov

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

Re: matrix graphs and individual labeling

Postby EViews Gareth » Mon Jun 06, 2011 3:41 pm

The only thing you can do in a program is break out each column as a separate vector, create a graph of that vector, customise the title using addtext(t), then merge all of the graphs into one master graph at the end. Yes, that is painful.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: matrix graphs and individual labeling

Postby EViews Glenn » Mon Jun 06, 2011 4:59 pm

I may be missing something, but wouldn't

Code: Select all

mygraph.setelem(1) legend("Actual Y") mygraph.setelem(2) legend("Predicted Y") ...
set the legends as desired on a *frozen* graph.

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

Re: matrix graphs and individual labeling

Postby EViews Gareth » Mon Jun 06, 2011 5:13 pm

It isn't the legends, it is the titles :(

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: matrix graphs and individual labeling

Postby tchaithonov » Mon Jun 06, 2011 6:08 pm

So, even though one can manually change the C1, C2, C(i), there is no coding equivalent of that? The thing is, I generated a set of data that is much shorter than the workfile sample. Alright. Guys, thanks anyways.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: matrix graphs and individual labeling

Postby EViews Glenn » Tue Jun 07, 2011 9:54 am

Ah...I missed the mult part.

Alternately, you can pad the matrix with NA rows to match the current workfile (or better yet copy into an appropriately sized new page). Do a mtos to get the series form, rename the series as desired, then do the graph. Painful, but possibly a bit easier than Gareth's.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests