<?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 group and styleattrs statements in proc sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Using-group-and-styleattrs-statements-in-proc-sgplot/m-p/567645#M18353</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use SAS 9.4 and am trying to plot bar charts with confidence intervals using proc sgplot. I want to differentiate one bar from the others by using a different color and created a column for group, assigning '1' to it and '2' to the rest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Test' is the output without assigning color to the groups&lt;/P&gt;&lt;P&gt;'Test1' is the output when I assign color (notice the error bars are gone)&lt;/P&gt;&lt;P&gt;I would like to have the different colors but retain the error bars and remove the group label at the bottom of the chart. See code below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;For test
/*Plot age group*/
ods listing gpath="&amp;amp;path/tasks/stl_conf/conf_new";
ods graphics / imagename="test1" imagefmt=png;
proc sgplot data=hist2.pop_by_age1;
styleattrs datacolors=(STYBR LIGRYBR);
vbarparm category=age_group response=Delta_Age /
   limitlower=L_Age limitupper=U_Age;
   title 'City Population Change by Age Group';
   yaxis label='Population change';
   xaxis label='Age';
run;

For test1
/*Plot age group*/
ods listing gpath="&amp;amp;path/tasks/stl_conf/conf_new";
ods graphics / imagename="test1" imagefmt=png;
proc sgplot data=hist2.pop_by_age1;
styleattrs datacolors=(STYBR LIGRYBR);
vbarparm category=age_group response=Delta_Age / group=group
   limitlower=L_Age limitupper=U_Age;
   title 'City Population Change by Age Group';
   yaxis label='Population change';
   xaxis label='Age';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2019 14:58:24 GMT</pubDate>
    <dc:creator>michokwu</dc:creator>
    <dc:date>2019-06-20T14:58:24Z</dc:date>
    <item>
      <title>Using group and styleattrs statements in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-group-and-styleattrs-statements-in-proc-sgplot/m-p/567645#M18353</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use SAS 9.4 and am trying to plot bar charts with confidence intervals using proc sgplot. I want to differentiate one bar from the others by using a different color and created a column for group, assigning '1' to it and '2' to the rest.&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Test' is the output without assigning color to the groups&lt;/P&gt;&lt;P&gt;'Test1' is the output when I assign color (notice the error bars are gone)&lt;/P&gt;&lt;P&gt;I would like to have the different colors but retain the error bars and remove the group label at the bottom of the chart. See code below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;For test
/*Plot age group*/
ods listing gpath="&amp;amp;path/tasks/stl_conf/conf_new";
ods graphics / imagename="test1" imagefmt=png;
proc sgplot data=hist2.pop_by_age1;
styleattrs datacolors=(STYBR LIGRYBR);
vbarparm category=age_group response=Delta_Age /
   limitlower=L_Age limitupper=U_Age;
   title 'City Population Change by Age Group';
   yaxis label='Population change';
   xaxis label='Age';
run;

For test1
/*Plot age group*/
ods listing gpath="&amp;amp;path/tasks/stl_conf/conf_new";
ods graphics / imagename="test1" imagefmt=png;
proc sgplot data=hist2.pop_by_age1;
styleattrs datacolors=(STYBR LIGRYBR);
vbarparm category=age_group response=Delta_Age / group=group
   limitlower=L_Age limitupper=U_Age;
   title 'City Population Change by Age Group';
   yaxis label='Population change';
   xaxis label='Age';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 14:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-group-and-styleattrs-statements-in-proc-sgplot/m-p/567645#M18353</guid>
      <dc:creator>michokwu</dc:creator>
      <dc:date>2019-06-20T14:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using group and styleattrs statements in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-group-and-styleattrs-statements-in-proc-sgplot/m-p/567693#M18355</link>
      <description>&lt;P&gt;To get rid of the legend, specify NOAUTOLEGEND on the PROC SGPLOT statement. To get your error bars back, you need to specify GROUPDISPLAY=CLUSTER on the VBARPARM statement. By default, grouped bars are STACKed, which does not support error bars, causing them to be dropped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 16:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-group-and-styleattrs-statements-in-proc-sgplot/m-p/567693#M18355</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-06-20T16:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using group and styleattrs statements in proc sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Using-group-and-styleattrs-statements-in-proc-sgplot/m-p/567697#M18356</link>
      <description>&lt;P&gt;Thank you so much. It works.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 16:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Using-group-and-styleattrs-statements-in-proc-sgplot/m-p/567697#M18356</guid>
      <dc:creator>michokwu</dc:creator>
      <dc:date>2019-06-20T16:23:52Z</dc:date>
    </item>
  </channel>
</rss>

