BookmarkSubscribeRSS Feed
wkossack
Calcite | Level 5
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?
1 REPLY 1
GraphGuy
Meteorite | Level 14
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 🙂

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 629 views
  • 0 likes
  • 2 in conversation