Hi SAS communities,
I am trying to split the xasix values in two lines with PROC SGPLOT but it is not working.
Thanks for your idea.
ODS LISTING CLOSE;
ODS HTML style=custom_plot IMAGE_DPI=500 PATH="&libpath.\06_Outputs\" ;
ODS GRAPHICS ON / width=1000px height=600px IMAGENAME="Serology_PRPP_PII" reset=index border=off ;
proc sgplot data=graph noborder noautolegend;
scatter x=group y=val / group=exp jitter JITTERWIDTH=0.3 name="a" markerattrs=(symbol=circlefilled Size=9) groupdisplay=cluster clusterwidth=0.2;
SCATTER x=group y=GMT / name="b" markerattrs=( symbol=squarefilled color=DAGRAY Size=8) yERRORLOWER=lower10 yERRORUPPER=upper10 ERRORBARATTRS=(THICKNESS=2) GROUPDISPLAY=CLUSTER;
styleattrs datacontrastcolors=( red blue )
DATASYMBOLS=( circlefilled );
yAXIS TYPE=LOG LOGSTYLE=LOGEXPAND MINOR LOGBASE=10 LABEL="Individual titers, GMT and 95% CIs" ;
xaxis label="Group" type=discrete fitpolicy=SPLITALWAYS SplitChar="-" offsetmin=0.15 offsetmax=0.15 ;
xaxistable gmt / NOMISSINGCHAR stat=mean location=inside label="GMT" LABELATTRS=(Color=black Family=Arial Size=14) VALUEATTRS=(Color=black Family=Arial Size=14);
KEYLEGEND "a" / TITLE="Experiment" noborder location=outside position=bottom ;
format gmt 8.2 lower10 8.0 upper10 8.0;
format val yax. ;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.