here's another idea if the various box plots can reasonably share a common y-axis
it rearranges data from the data set SASHELP.PRDSAL2 so you can display three
different box plots all in one PROC BOXPLOT ... three different variables used on the
the x-axis ...you have 4, a1-a4
you also have 4 different y-vars, but you can also rename dm1-dm4 to a common name
and combine the data as I do here
maybe this is 'overkill', but it does get three different variables ... or three separate boxplots ...
all into one PNG file
*
use a SASHELP data set
rearrange the data for use in PROC BOXPLOT
the PUT statements show the values to use in PROC FORMAT
;
proc sort data=sashelp.prdsal2 (keep=country actual) out=co;
by country;
run;
data co;
set co;
by country;
group + first.country;
if first.country then put country=;
run;
proc sort data=sashelp.prdsal2 (keep=prodtype actual) out=pr;
by prodtype;
run;
data pr;
set pr;
by prodtype;
group + first.prodtype;
if first.prodtype then put prodtype=;
run;
proc sort data=sashelp.prdsal2 (keep=year actual) out=yr;
by year;
run;
data yr;
set yr;
by year;
group + first.year;
if first.year then put year=;
run;
* combine all the data sets;
data all;
set co (in=c) pr(in=p) yr(in=y);
if c then name = 'Country';
else
if p then do;
group+4;
name = 'Type';
end;
else do;
group+7;
name = 'Year';
end;
run;
* specify labels for the x-axis (based on groups shown in the LOG after running data step;
proc format;
value group
1 = 'Canada'
2 = 'Mexico'
3 = 'USA'
5 = 'Furniture'
6 = 'Office'
8 = '1995'
9 = '1996'
10 = '1997'
11 = '1998'
4,7 = ' '
;
run;
* create a PNG file;
goptions reset=all ftext='calibri' htext=3 gunit=pct
dev=png xpixels=2000 ypixels=1500 gsfname=gout;
axis1 value=(a=45 h=2) label=none major=none;
* add some white space around the plot;
title1 ls=2;
title2 ls=1 a=90;
title3 ls=1 a=-90;
footnote1 ls=1;
filename gout 'z:\box.png';
proc boxplot data=all;
plot actual * group (name) / continuous boxstyle=schematic haxis=axis1;
format group group.;
run;