BookmarkSubscribeRSS Feed
xxformat_com
Barite | Level 11

Hi,

 

I came across a really strange behaviour yesterday. I've found a solution for my specific case but I've created an example for you.

 

fillpattern is not supported with dattrmap as mentionned by Dan

https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-dattrmap/m-p/563684

 

Some templates like journal2 and journal3 use pattern attribute. I haven't further investigate this approach. Feel free to add the solution with proc template if you know it.

 

Right now I've tried to use styleattrs statement.

 

For todays message I've searched and there you have the following exemple: https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Vbar-graph-Data-with-Different-color-and-...

 

But my problem is as follow: As soon as I add a second background color with datacolors=, only the first pattern is applied.

 

proc sort data=sashelp.class
          out=class;
    by age sex;
run;    


proc sgplot data=class;
    vbarbasic age / response=height 
                    stat=mean 
                    group=sex 
                    groupdisplay=cluster
                    fillpattern;
    
    	styleattrs datafillpatterns  =(r1 l1)
	               datacontrastcolors=(red blue) 
	               datacolors        =(yellow pink);
run;

The workaround I used is to plot twice the graph: once with just the background and once with the pattern combined with the nofill option.

 

But my first thought here is that it is a bug. How about you?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 0 replies
  • 50 views
  • 0 likes
  • 1 in conversation