<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using styleattrs to assign multiple patterns in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Using-styleattrs-to-assign-multiple-patterns/m-p/935701#M24780</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fillpattern is not supported with dattrmap as mentionned by Dan&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-dattrmap/m-p/563684" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-dattrmap/m-p/563684&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Right now I've tried to use styleattrs statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For todays message I've searched and there you have the following exemple: &lt;A href="https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Vbar-graph-Data-with-Different-color-and-Pattern/m-p/826032" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Vbar-graph-Data-with-Different-color-and-Pattern/m-p/826032&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But my problem is as follow: As soon as I add a second background color with datacolors=, only the first pattern is applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But my first thought here is that it is a bug. How about you?&lt;/P&gt;</description>
    <pubDate>Sat, 13 Jul 2024 10:58:38 GMT</pubDate>
    <dc:creator>xxformat_com</dc:creator>
    <dc:date>2024-07-13T10:58:38Z</dc:date>
    <item>
      <title>Using styleattrs to assign multiple patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-styleattrs-to-assign-multiple-patterns/m-p/935701#M24780</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fillpattern is not supported with dattrmap as mentionned by Dan&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-dattrmap/m-p/563684" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/Graphics-Programming/Proc-sgplot-dattrmap/m-p/563684&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Right now I've tried to use styleattrs statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For todays message I've searched and there you have the following exemple: &lt;A href="https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Vbar-graph-Data-with-Different-color-and-Pattern/m-p/826032" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/Graphics-Programming/SGPLOT-Vbar-graph-Data-with-Different-color-and-Pattern/m-p/826032&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But my problem is as follow: As soon as I add a second background color with datacolors=, only the first pattern is applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But my first thought here is that it is a bug. How about you?&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2024 10:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-styleattrs-to-assign-multiple-patterns/m-p/935701#M24780</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2024-07-13T10:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using styleattrs to assign multiple patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-styleattrs-to-assign-multiple-patterns/m-p/935721#M24785</link>
      <description>&lt;P&gt;You need a special option ATTRPRIORITY=NONE to make it happen.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class
          out=class;
    by age sex;
run;    

ods graphics/attrpriority=none;
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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1720923633647.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98391i3183696B60E43BCC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1720923633647.png" alt="Ksharp_0-1720923633647.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 02:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-styleattrs-to-assign-multiple-patterns/m-p/935721#M24785</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-14T02:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using styleattrs to assign multiple patterns</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-styleattrs-to-assign-multiple-patterns/m-p/935736#M24787</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 06:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-styleattrs-to-assign-multiple-patterns/m-p/935736#M24787</guid>
      <dc:creator>xxformat_com</dc:creator>
      <dc:date>2024-07-14T06:19:53Z</dc:date>
    </item>
  </channel>
</rss>

