Page 1 of 1

Graphs: how to label left axis but not right?

Posted: Wed Sep 16, 2015 5:59 am
by mamo
Dear Eviews team,
using Eviews 9 build april 2009.
I would like to have labels at the right axis of a line chart but no labels left.
The following code does not deliver the expected labeling:

Code: Select all

wfcreate a 2000 2015 series x = nrnd freeze(o, gra) x.line gra.axis(left) -label gra.axis(right) +label show gra
What is wrong here?
Also, it does not seem to be possible to obtain the wanted result manually.
In Graph Options - Axes & Scaling - Data axis labels I can check-mark Label both Axes/ Duplicate axes labels. But then, check-marking Hide Labels in the left axis options while un-marking the same item in the right axis options unexpectedly removes labels from both axes.
Is there a way to obtain the wanted result, manually as well as with some program code?
Best,
mamo

Re: Graphs: how to label left axis but not right?

Posted: Wed Sep 16, 2015 8:47 am
by EViews Jason
You can't have more axis then series.

Do you really want ticks on the left axis and labels on the right? Or do you want to just move the axis from the left to the right?

If it is the latter, use:

Code: Select all

wfcreate a 2000 2015 series x = nrnd freeze(o, gra) x.line gra.setelem(1) axis(r) show gra
Assuming you do want ticks on the left axis and the labels on the right, you will need to create a group whereby the series is in the group twice. Then assign one of the series to the right axis.

Code: Select all

wfcreate a 2000 2015 series x = nrnd group g x x freeze(o, gra) g.line gra.setelem(1) axis(r) gra.axis overlap gra.axis(left) -label gra.axis(right) +label ticksnone gra.setelem(1) legend() 'hide on the legend label for the first series show gra

Re: Graphs: how to label left axis but not right?

Posted: Thu Sep 17, 2015 1:53 am
by mamo
Hi,
many thanks for the reply which has resolved the issue. In fact, the 2nd was what I wanted (I have mixed axes up in the subject header).
Best,
mamo