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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 312 views
  • 7 likes
  • 2 in conversation