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

 

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