<?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 Assigning specific colors to specified legend category in SGPLOT? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-specific-colors-to-specified-legend-category-in-SGPLOT/m-p/561270#M18192</link>
    <description>&lt;P&gt;Does anyone know how to assign specific colors to specific bars/legend groups in SGPLOT? For example in my figure, I used: datacolors=(white black grey);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and thus the first bar ("one") was depicted as white, group "two" was depicted as black and "three" as grey. This would be fine, however, because I am creating many graphs, it becomes tedious and time consuming to reorder the colors in the datacolors statement if it so happens that the first occurrence in my data is group "two" (i.e. group "two" would be colored white, which would be inconsistent with my previous graphs).&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am assuming there is a way to assign the colors like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"one"=white,&amp;nbsp;&lt;/P&gt;&lt;P&gt;"two"=black,&lt;/P&gt;&lt;P&gt;"three"=grey&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I am unfamiliar with how to do so. I'm using SAS v9.4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.JPG" style="width: 258px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29747i24C8E3AA53541B98/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.JPG" alt="pic.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2019 01:25:10 GMT</pubDate>
    <dc:creator>richart</dc:creator>
    <dc:date>2019-05-24T01:25:10Z</dc:date>
    <item>
      <title>Assigning specific colors to specified legend category in SGPLOT?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-specific-colors-to-specified-legend-category-in-SGPLOT/m-p/561270#M18192</link>
      <description>&lt;P&gt;Does anyone know how to assign specific colors to specific bars/legend groups in SGPLOT? For example in my figure, I used: datacolors=(white black grey);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and thus the first bar ("one") was depicted as white, group "two" was depicted as black and "three" as grey. This would be fine, however, because I am creating many graphs, it becomes tedious and time consuming to reorder the colors in the datacolors statement if it so happens that the first occurrence in my data is group "two" (i.e. group "two" would be colored white, which would be inconsistent with my previous graphs).&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am assuming there is a way to assign the colors like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"one"=white,&amp;nbsp;&lt;/P&gt;&lt;P&gt;"two"=black,&lt;/P&gt;&lt;P&gt;"three"=grey&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I am unfamiliar with how to do so. I'm using SAS v9.4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.JPG" style="width: 258px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29747i24C8E3AA53541B98/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.JPG" alt="pic.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 01:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-specific-colors-to-specified-legend-category-in-SGPLOT/m-p/561270#M18192</guid>
      <dc:creator>richart</dc:creator>
      <dc:date>2019-05-24T01:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning specific colors to specified legend category in SGPLOT?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-specific-colors-to-specified-legend-category-in-SGPLOT/m-p/561285#M18193</link>
      <description>&lt;P&gt;Use a data attribute map.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's an example here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=p18q268a3zxcl3n11lnnnq4cme8r.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=p18q268a3zxcl3n11lnnnq4cme8r.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240551"&gt;@richart&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Does anyone know how to assign specific colors to specific bars/legend groups in SGPLOT? For example in my figure, I used: datacolors=(white black grey);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and thus the first bar ("one") was depicted as white, group "two" was depicted as black and "three" as grey. This would be fine, however, because I am creating many graphs, it becomes tedious and time consuming to reorder the colors in the datacolors statement if it so happens that the first occurrence in my data is group "two" (i.e. group "two" would be colored white, which would be inconsistent with my previous graphs).&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am assuming there is a way to assign the colors like:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"one"=white,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"two"=black,&lt;/P&gt;
&lt;P&gt;"three"=grey&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but I am unfamiliar with how to do so. I'm using SAS v9.4.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.JPG" style="width: 258px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29747i24C8E3AA53541B98/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.JPG" alt="pic.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 02:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-specific-colors-to-specified-legend-category-in-SGPLOT/m-p/561285#M18193</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-24T02:41:39Z</dc:date>
    </item>
  </channel>
</rss>

