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

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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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