Greetings.
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.
Regards,
Jaco
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= .
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.
ods listing style=journal;
proc sgplot data=sashelp.cars(where=(type ne 'Hybrid'));
vbox mpg_city / category=Origin group=type nofill;
run;
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.
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)
whiskerattrs=(pattern=solid);
run;
Thank you Sanjay for taking your time to help me. I sincerely appreciate it!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: