Graphs: how to label left axis but not right?

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

mamo
Posts: 205
Joined: Wed Nov 07, 2012 9:11 am

Graphs: how to label left axis but not right?

Postby mamo » Wed Sep 16, 2015 5:59 am

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

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

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

Postby EViews Jason » Wed Sep 16, 2015 8:47 am

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

mamo
Posts: 205
Joined: Wed Nov 07, 2012 9:11 am

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

Postby mamo » Thu Sep 17, 2015 1:53 am

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests