I have the following code which works. Can someone tell me how to modify the code so that the graph will have patterns instead of color?
ods pdf file='/folders/myfolders/Cmax_con/peaksdistr.pdf/';
ods graphics on /width=4 in;
title 'Cmax distribution Peak1';
proc sgplot data=peak1;
histogram y/ legendlabel='Calculated Cmax' fillattrs=(color=red) name= 's' legendlabel ='Calculated Cmax' transparency=0.5 ;
histogram dv/ legendlabel='Calculated Cmax' fillattrs=(color=green) name= 'o' legendlabel ='Observed Cmax' transparency=0.5 ;
keylegend 's' 'o' /location=inside position =topright across=1;
xaxis label='ng/ml';
run;
ods pdf close;
You might prefer one of the journal styles.
Perhaps add style=journal2 to your ODS PDF statement.
You might prefer one of the journal styles.
Perhaps add style=journal2 to your ODS PDF statement.
For v940m5, it is as simple as specifying FILLPATTERN and NOFILL on both HISTOGRAM statements. However, for prior versions, you will need to make an ODS style change to get the patterns. Something like the following:
proc template;
define style styles.mypat;
parent=styles.HTMLBlue;
style Graphhistogram from GraphComponent /
displayopts = "outline fillpattern"
;
end;
run;
ods html style=styles.mypat;
proc sgplot data=sashelp.class;
histogram weight;
histogram height;
run;
FILLPATTERN is an option on the Histogram statement if you want manual control of the patterns.
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.