Data visualization with SAS programming

vaxis not coming out the same on gplot

Reply
Contributor
Posts: 29

vaxis not coming out the same on gplot

I have a regression and I'm trying to plot the predicted with the actual on the same plot. I'm trying to get the verticle scale to be the same but for some reason one chart has the right axis different than the left

SYMBOL1 INTERPOL=JOIN HEIGHT=10pt VALUE=CIRCLE LINE=1 WIDTH=2;

Axis1 STYLE=1 WIDTH=1 Major = (NUMBER=5) MINOR=NONE;
Axis2 STYLE=1 WIDTH=1 MINOR=NONE ;
Axis3 STYLE=1 WIDTH=1 Major = (NUMBER=5) MINOR=NONE;

TITLE1 "Scatter Plot";
FOOTNOTE;

PROC GPLOT DATA=PREDLINREGPREDICTIONS NOCACHE ;
format offered COMMA12.;
format predicted_offered COMMA12.;
PLOT offered * month_year=1 / VAXIS=AXIS1 HAXIS=AXIS2
FRAME VZERO LEGEND=LEGEND1;
PLOT2 predicted_offered * month_year = 2 /
VAXIS=AXIS3 LEGEND=LEGEND1 VZERO OVERLAY;
BY Grouping;

what am I missing?
SAS Employee
Posts: 967

Re: vaxis not coming out the same on gplot

If you don't specify an "order={min} to {max} by {something}" in your axis statements, then the plot and plot2 axes will each auto-scale based on the data that's being plotted against that axis.

One alternative to plotting the 2 lines via plot and plot2 is to plot them both with the plot statement (using the 'overlay' option). You will only get an axis on the left side, and you are guaranteed that axis is auto-scaled the same for both lines (ie, because it *is* the same axis Smiley Happy
Ask a Question
Discussion stats
  • 1 reply
  • 147 views
  • 0 likes
  • 2 in conversation