<?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 VBARs of different colors in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109974#M4130</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a bar graph with a 6-level categorical variable (SLNLOS) and the investigator wants three of the bars to be one color and three bars to be another color. I'm not great at template modification and I can't think of how I would change the color of three levels of the variable since it's rather arbitrary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may be pertinent that it has to be a 600 DPI .tiff per the journal requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing image_dpi=600;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics on/ imagefmt=tiff imagename="Final Figure 2";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sgplot data=long;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbar slnlos/response=inp stat=mean;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Meredith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Apr 2013 13:47:51 GMT</pubDate>
    <dc:creator>MeredithG</dc:creator>
    <dc:date>2013-04-16T13:47:51Z</dc:date>
    <item>
      <title>VBARs of different colors</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109974#M4130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a bar graph with a 6-level categorical variable (SLNLOS) and the investigator wants three of the bars to be one color and three bars to be another color. I'm not great at template modification and I can't think of how I would change the color of three levels of the variable since it's rather arbitrary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may be pertinent that it has to be a 600 DPI .tiff per the journal requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing image_dpi=600;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods graphics on/ imagefmt=tiff imagename="Final Figure 2";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sgplot data=long;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbar slnlos/response=inp stat=mean;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Meredith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 13:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109974#M4130</guid>
      <dc:creator>MeredithG</dc:creator>
      <dc:date>2013-04-16T13:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: VBARs of different colors</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109975#M4131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Meredith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe you will need to "assign" a group to &lt;EM&gt;inp&lt;/EM&gt; variable, such that if &lt;EM&gt;inp&lt;/EM&gt; is one of the three bars value then grp = 1, else grp = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you could use this code:&lt;/P&gt;&lt;P&gt;proc template;&lt;/P&gt;&lt;P&gt;define statgraph my_design;&lt;/P&gt;&lt;P&gt;begingraph;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; barchart x=slnlos y=inp/ group=GRP&lt;/STRONG&gt; name='bar' clusterwidth=1.0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; endlayout;&lt;/P&gt;&lt;P&gt;endgraph;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgrender data=WORK.long template=my_design;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does this make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 13:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109975#M4131</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-04-16T13:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: VBARs of different colors</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109976#M4132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome, thank you! I really need to sit down and spend some time figuring out template modification... ugh...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 14:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109976#M4132</guid>
      <dc:creator>MeredithG</dc:creator>
      <dc:date>2013-04-16T14:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: VBARs of different colors</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109977#M4133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this with proc SGPLOT too:&lt;/P&gt;&lt;P&gt;&amp;nbsp; vbar slnlos / response=inp stat=mean group=grp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have SAS 9.3, you can use the DATTRMAP to do this.&amp;nbsp; Set GRP=slnlos, and then defining an attribues map with specific colors for each category value.&amp;nbsp; See:&amp;nbsp; &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2013/04/02/attribute-maps-1/" title="http://blogs.sas.com/content/graphicallyspeaking/2013/04/02/attribute-maps-1/"&gt; Attribute Maps &amp;amp;#8211; 1 - Graphically Speaking&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 16:48:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/VBARs-of-different-colors/m-p/109977#M4133</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2013-04-16T16:48:49Z</dc:date>
    </item>
  </channel>
</rss>

