08-18-2014 04:12 PM
I am quite new in SAS and I have been struggling to change the display of my boxplots from colored to filled patterns in the following codes:
I am using SAS 9.3. Please help me as I have tried everything possible to include the pattern fill attributes in the above code but I keep getting warnings and yet nothing changed!I prefer to differentiate the four group boxplots using fill patterns instead of colors. Please what adjustment do I need to make in the above code to actualize this?
Thanks in advance for helping me out.
08-18-2014 04:48 PM
Fill patterns are not supported for BoxPlot.
You can get empty boxes with different line patterns for the box.
If your data has groups (instead of 4 separate columns), you can use GROUP= .
08-18-2014 05:54 PM
Thank you Sanjay@SAS for your swift reply. However, I am a bit confused on how I can use the GROUP= as I am still a newbie in SAS. Could you please elaborate further on how to actualize the empty boxplots with different line patterns, if you don't mind? I have attached the data I used to create the boxplots and the above codes worked pretty on them. The only thing I need is to change the default colors to fill patterns or empty boxes with line patterns. Please kindly help me.
08-19-2014 12:59 AM
Many thanks, Sanjay. I have just tried to incorporate vbox mpg_city / category=Origin group=type nofill into the code, but it seems I would only have empty boxes. Please how would I differentiate them with line patterns as you mentioned above? The graphs will be printed in black and white and therefore, colors are not allowed! Please help me. I am only a newbie and my level of understanding is quite low.
08-19-2014 09:22 AM
Each box in the graph uses a different line pattern for the box and the whisker by group.
Maybe you can also use gray scale fill.
ods listing style=journal;
proc sgplot data=sashelp.cars(where=(type ne 'Hybrid'));
vbox mpg_city / category=Origin group=type lineattrs=(pattern=solid)