Hi,
I am attempting to use sgplot to generate a boxplot using vbox that also displays two horizontal reference lines across the page, but where the reference lines cross the box, I would like the lines to be invisible. Using my code (show below), the references lines are visible where they cross the box and I am not sure which options are available to allow me to hide the parts of the reference lines that occupy the same space as the box. I tried playing around with the "transparency" option in different places without success.
Thanks
ods listing gpath='C:\Output' image_dpi=600;
ods graphics on/reset=all border=off imagefmt=tiff imagename='My plot';
proc sgplot data=data_x;
vbox yvar/boxwidth=0.15 fill fillattrs=(color=white) meanattrs=(symbol=plus size=8) outlierattrs=(symbol=circle size=5);
refline 96 98/axis=y lineattrs=(pattern=20 color=black);
yaxis label="my label" labelattrs=(size=14) valueattrs=(size=13) minor minorcount=1;
run;
quit;
ods graphics off;
Reference lines are like plots - the order in which they are specified is important. The first plot statement is drawn first, and the next one top of that. To fix your issue, specify the REFLINE statement before the VBOX.
Reference lines are like plots - the order in which they are specified is important. The first plot statement is drawn first, and the next one top of that. To fix your issue, specify the REFLINE statement before the VBOX.
Thanks!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.