Sorry if this is the wrong location. It's confusing to figure out which one is the correct forum, but I want to rename the y-axis of the plot that is produced by
proc plot;
plot energy_weekday * temp = 'W'
energy_weekend * temp = 'S'
/overlay;
to "energy" (right now, the plot shows "energy_weekday" as the y-axis).
Put a label statement into the code
proc plot;
plot energy_weekday * temp = 'W' energy_weekend * temp = 'S'/overlay;
label energy_weekday='Energy';
run;
Put a label statement into the code
proc plot;
plot energy_weekday * temp = 'W' energy_weekend * temp = 'S'/overlay;
label energy_weekday='Energy';
run;
Haven't used Proc PLOT in over 30 years.
Is there a reason you don't want a nicer looking plot or is this intended for line-printer output?
This is what my team has been doing since before I joined. What do you recommend instead?
With any version of SAS since 9.1 I would be using Proc SGPLOT or SGPANEL for plots.
You should have the SASHELP.Class data set available to test the following code which produces two similar plots:
proc plot data=sashelp.class; plot weight*height /vpos=25 ; run; proc sgplot data=sashelp.class; scatter x=height y=weight/markerattrs=(color=blue) transparency=.5; run;
I used the transparency setting to make the colors in the SGPLOT output a bit transparent so when multiple values overlay that is shown by a more intense color fill instead of the letter B in the Plot result.
Sgplot adds multiple types of graphs, quite a bit more appearance options and will create pretty nice appearing output when sent to document formats like PDF and RTF.
Sorry for the late reply, but I appreciate the info. Is it something that is covered in the courses? Thanks.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.