<?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: Assigning colors and dictating which shows first in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/937003#M24836</link>
    <description>&lt;P&gt;You probably want to use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n0p7vdd69sgf3wn1479qxqxuryrt.htm" target="_self"&gt;GROUPORDER=DESCENDING&lt;/A&gt; option of the VBAR statement to force males to come first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To force the colors to be something specific and unchanging, you can use a &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n18szqcwir8q2nn10od9hhdh2ksj.htm" target="_self"&gt;discrete attribute map&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2024 15:14:23 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-07-24T15:14:23Z</dc:date>
    <item>
      <title>Assigning colors and dictating which shows first</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/936998#M24834</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating graphics depicting trends of catastrophic sport injuries in all U.S. states. I want to make sure my colors are consistent for each scenario and state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In one of my vbar graphs, I am showing injuries by sport and sex. I want to make sure athletesex will be blue for male and red for female. Additionally, I want to make sure that the blue bar showing males appears on the left side of the red. Right now, I think SAS is automatically putting the one with a higher value to the left, and I do not want that. My code is below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=sreportlabels;&lt;BR /&gt;title "Frequency of Catastrophic Sport Injuries by Sport and Sex in Alabama (2013-2022)";&lt;BR /&gt;vbar injurysport / group=athletesex groupdisplay=Cluster;&lt;BR /&gt;xaxis label = "Sport";&lt;BR /&gt;yaxis label = "Frequency" values = (0 to 20 by 5);&lt;BR /&gt;where state = "Alabama";&lt;BR /&gt;run;&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="lilyduboff_0-1721833588918.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98699i3A8D3804B987D3C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lilyduboff_0-1721833588918.png" alt="lilyduboff_0-1721833588918.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 15:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/936998#M24834</guid>
      <dc:creator>lilyduboff</dc:creator>
      <dc:date>2024-07-24T15:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning colors and dictating which shows first</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/937003#M24836</link>
      <description>&lt;P&gt;You probably want to use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n0p7vdd69sgf3wn1479qxqxuryrt.htm" target="_self"&gt;GROUPORDER=DESCENDING&lt;/A&gt; option of the VBAR statement to force males to come first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To force the colors to be something specific and unchanging, you can use a &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n18szqcwir8q2nn10od9hhdh2ksj.htm" target="_self"&gt;discrete attribute map&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 15:14:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/937003#M24836</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-07-24T15:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning colors and dictating which shows first</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/937005#M24837</link>
      <description>&lt;P&gt;This is the reply from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;before this was moved to the Graphics Programming community.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;You need to create and use a discrete attribute map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n18szqcwir8q2nn10od9hhdh2ksj.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n18szqcwir8q2nn10od9hhdh2ksj.htm&lt;/A&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 24 Jul 2024 15:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/937005#M24837</guid>
      <dc:creator>Madelyn_SAS</dc:creator>
      <dc:date>2024-07-24T15:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning colors and dictating which shows first</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/937072#M24840</link>
      <description>Alternative way is sorting your data before PROC SGPLOT like:&lt;BR /&gt;&lt;BR /&gt;proc sort data=sreportlabels;&lt;BR /&gt;by sex;&lt;BR /&gt;run;</description>
      <pubDate>Thu, 25 Jul 2024 01:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Assigning-colors-and-dictating-which-shows-first/m-p/937072#M24840</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-25T01:41:53Z</dc:date>
    </item>
  </channel>
</rss>

