SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
rmacarthur
Pyrite | Level 9

Hi SAS friends, 

Am using Proc SGpanel to create a single panel graph with 3 groups, and 3 subgroups. 

I"d like the subgroup vbars to have the same fill pattern across the three main groups, that is Mo has one fill pattern, Larry has a different one, as does Curly. 

Have looked at the online help and have had no luck in solving.

Attached is a sample dataset, and current graph image and here's the current code.

/* START metabolite % figure */
ods listing;
ods html path="&out.\" (url=NONE) style=journal;
ods graphics on /attrpriority=none imagename="Met_Pct" imagefmt=png noborder;
ODS HTML	;

Title1	color=black height=2	"Bryl cream use amongst early comedians" ;
proc format;
			value O_No
				1='Winken'
				2='Blinken'
				3='Nod'
				;
			value 	C_No
				1='Mo'
				2='Larry'
				3='Curly'
				;
run;
proc sgpanel data	=	sf.MLC		  noautolegend  ;
	format	O_No	O_No.		C_No	C_No.	;
  	panelby O_No 		/ 	onepanel layout=columnlattice colheaderpos=top /*noborder*/ novarname; 
  	vbar 	C_No 	/ 		dataskin=crisp groupdisplay=cluster response=pct grouporder=data ;
  	rowaxis 	label="%"	min	=	0 	max	=	80 	valueattrs=(size=8)	;
  colaxis 	 display=(nolabel)	;  
run;
ods graphics off;
ods html close;
/* END	metabolite % figure */

Would greatly appreciate help in solving this one !

Thank you !

 

 

 

  

1 ACCEPTED SOLUTION

Accepted Solutions
rmacarthur
Pyrite | Level 9

Recreate the graph using Proc SGPlot, V-bar option.

Proc SG Panel does not easily support the V-bar fill needed, while Proc SGPlot was able to do it easily.

View solution in original post

3 REPLIES 3
rmacarthur
Pyrite | Level 9

Recreate the graph using Proc SGPlot, V-bar option.

Proc SG Panel does not easily support the V-bar fill needed, while Proc SGPlot was able to do it easily.

Ksharp
Super User
ods graphics/attrpriority=none;
proc sgpanel data=sashelp.heart noautolegend ;
panelby bp_Status/ 	onepanel layout=columnlattice colheaderpos=top /*noborder*/ novarname; 
vbar smoking_status	/group=smoking_status nofill fillpattern dataskin=crisp groupdisplay=cluster response=weight grouporder=data ;
run;

Ksharp_0-1733191522977.png

 

rmacarthur
Pyrite | Level 9

Thank you !  Sorry for the late reply !

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 3 replies
  • 751 views
  • 1 like
  • 2 in conversation