Hi all,
I would like to plot graph as below.
X-axis has 2 labels.
what's the command i should do?
proc sgplot data=tmp;
series x=rownum y=avg ;
xaxis label="X axis";
run;
You probably want to combine the LABEL= option for the XAXIS statement with teh global FOOTNOTE statement.
Experiment with using the FOOTNOTE JUSTIFY= option to get what you want.
You might also need to move the legend around. Here's an example to get started:
footnote justify=center "X axis";
proc sgplot data=sashelp.class;
vbar age / group=sex response=height stat=mean groupdisplay=cluster;
xaxis label="(Time)" labelpos=right;
keylegend / position=topleft location=inside;
run;
What version of SAS do you have?
Have you looked at annotate?
You probably want to combine the LABEL= option for the XAXIS statement with teh global FOOTNOTE statement.
Experiment with using the FOOTNOTE JUSTIFY= option to get what you want.
You might also need to move the legend around. Here's an example to get started:
footnote justify=center "X axis";
proc sgplot data=sashelp.class;
vbar age / group=sex response=height stat=mean groupdisplay=cluster;
xaxis label="(Time)" labelpos=right;
keylegend / position=topleft location=inside;
run;
Here is how to do this with SG annotation:
data anno;
function="text";
drawspace="layoutpercent";
anchor="topright";
x1=100; y1=7;
label="Years";
run;
proc sgplot data=sashelp.class noautolegend sganno=anno;
vbar age / group=sex groupdisplay=cluster barwidth=0.8;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.