BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sasguy299
Fluorite | Level 6

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;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

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.

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

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.

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 657 views
  • 7 likes
  • 2 in conversation