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

Hi ,

 

How to do one of visit group (phone visit) pattern set as empty (no fill ) in below plot (rest of one as same pattern).

 

Below is code i am using.

 

proc sgplot data=vis0;
   
	   vbar col1/ response=COL1 group=col2grouporder=data groupdisplay=stack
	                 fillattrs=(color="white") 
	   				   outlineattrs=(color="black") fillpattern fillpatternattrs=(color="black");
	   keylegend / position=bottom title="Type of cat";
	   yaxis grid label="Number of types";
	   xaxis display=(nolabel) discreteorder=data valueattrs=(size=7);
	run;

Thank you,

Raja.

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

I suggest to use the STYLEATTRS statement available with Proc SGPLOT. Give the following code a go. My example has only 3 group values, so in your example just add a fourth color and fillpattern (Ln, Xn, Rn where n is a number between 1-5).

 


proc sgplot data=sashelp.cars;
  styleattrs
    datacontrastcolors=(black white black)
    datafillpatterns=(l1 x5 r1)
  ;
  vbar type /
    group=origin response=invoice stat=mean
    outlineattrs=(color="black")
    fillpattern
    nofill
  ;
run;

View solution in original post

2 REPLIES 2
BrunoMueller
SAS Super FREQ

I suggest to use the STYLEATTRS statement available with Proc SGPLOT. Give the following code a go. My example has only 3 group values, so in your example just add a fourth color and fillpattern (Ln, Xn, Rn where n is a number between 1-5).

 


proc sgplot data=sashelp.cars;
  styleattrs
    datacontrastcolors=(black white black)
    datafillpatterns=(l1 x5 r1)
  ;
  vbar type /
    group=origin response=invoice stat=mean
    outlineattrs=(color="black")
    fillpattern
    nofill
  ;
run;

Ksharp
Super User

COOL !

 

ods graphics/attrpriority=none;
proc sgplot data=sashelp.class ;
styleattrs DATAFILLPATTERNS=(r1 r2 x4 l1 l4 l2) 
datacontrastcolors=(black black white black black black);
vbar sex/group=age response=weight 
 fillattrs=(color="white") outlineattrs=(color="black")
 fillpattern   ;

run;

Ksharp_0-1642423949667.png

 

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