<?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 Re: How to se color in vbar sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-se-color-in-vbar-sgplot/m-p/529026#M17693</link>
    <description>&lt;P&gt;Thank you, didnt realise I needed to specify groups= , thought that would be implicit.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jan 2019 12:28:46 GMT</pubDate>
    <dc:creator>Ullsokk</dc:creator>
    <dc:date>2019-01-22T12:28:46Z</dc:date>
    <item>
      <title>How to se color in vbar sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-se-color-in-vbar-sgplot/m-p/529020#M17691</link>
      <description>&lt;P&gt;I want both graphs to have the same color for the class variable. For the histogram, the coloring is set by&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;styleattrs DATACOLORS=(blue red )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But how do I set the&amp;nbsp;same colors to differentiate between the classes in the vbar?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let _input = sashelp.bweight;
%let class=black;
%let response=weight ;

proc sgplot data=&amp;amp;_input.;
title "Distribution &amp;amp;response."; 
styleattrs DATACOLORS=(blue red );
histogram &amp;amp;response. / group=&amp;amp;class. transparency=0.5;
density &amp;amp;response.  / group=&amp;amp;class. lineattrs=(pattern=solid);
xaxis display=(nolabel);
run;&lt;BR /&gt;
proc sgplot data=&amp;amp;_input.;
styleattrs DATACOLORS=(blue red ) ;
title  "Mean &amp;amp;response. per &amp;amp;class. ";
vbar &amp;amp;class. / response=&amp;amp;response. stat=Mean name='Bar'  filltype= solid datalabel;
yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vbar.PNG" style="width: 388px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26422i30A5B2752396FF19/image-size/large?v=v2&amp;amp;px=999" role="button" title="vbar.PNG" alt="vbar.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 12:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-se-color-in-vbar-sgplot/m-p/529020#M17691</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2019-01-22T12:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to se color in vbar sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-se-color-in-vbar-sgplot/m-p/529022#M17692</link>
      <description>&lt;P&gt;Add the GROUP= Option to the VBAR Options to make the procedure alter between the specified datacolors&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let _input = sashelp.bweight;
%let class=black;
%let response=weight ;

proc sgplot data=&amp;amp;_input.;
title "Distribution &amp;amp;response."; 
styleattrs DATACOLORS=(blue red);
histogram &amp;amp;response. / group=&amp;amp;class. transparency=0.5;
density &amp;amp;response.  / group=&amp;amp;class. lineattrs=(pattern=solid);
xaxis display=(nolabel);
run;

proc sgplot data=&amp;amp;_input.;
styleattrs datacolors=(blue red) ;
title  "Mean &amp;amp;response. per &amp;amp;class. ";
vbar &amp;amp;class. / group=&amp;amp;class. response=&amp;amp;response. stat=Mean name='Bar' filltype=solid datalabel;
yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit: Also, you can add the &lt;STRONG&gt;transparency=0.5&lt;/STRONG&gt; to the VBAR option (as in the histogram options) to make the colors exactly the same.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="SGPlot13.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26423i4000FC45799E7676/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot13.png" alt="SGPlot13.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>Tue, 22 Jan 2019 12:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-se-color-in-vbar-sgplot/m-p/529022#M17692</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-22T12:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to se color in vbar sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-se-color-in-vbar-sgplot/m-p/529026#M17693</link>
      <description>&lt;P&gt;Thank you, didnt realise I needed to specify groups= , thought that would be implicit.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 12:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-se-color-in-vbar-sgplot/m-p/529026#M17693</guid>
      <dc:creator>Ullsokk</dc:creator>
      <dc:date>2019-01-22T12:28:46Z</dc:date>
    </item>
  </channel>
</rss>

