Page 1 of 1

matrix graphs and individual labeling

Posted: Mon Jun 06, 2011 3:26 pm
by tchaithonov
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

Re: matrix graphs and individual labeling

Posted: Mon Jun 06, 2011 3:41 pm
by EViews Gareth
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.

Re: matrix graphs and individual labeling

Posted: Mon Jun 06, 2011 4:59 pm
by EViews Glenn
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.

Re: matrix graphs and individual labeling

Posted: Mon Jun 06, 2011 5:13 pm
by EViews Gareth
It isn't the legends, it is the titles :(

Re: matrix graphs and individual labeling

Posted: Mon Jun 06, 2011 6:08 pm
by tchaithonov
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.

Re: matrix graphs and individual labeling

Posted: Tue Jun 07, 2011 9:54 am
by EViews Glenn
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.