<?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 PROC SGPLOT VBOX — how to get consistent colors across the BY groups in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529393#M17694</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
	by sex;
run;
proc sgplot data=class;
styleattrs;
	by sex;
    vbox height/group=age grouporder=ascending;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;produces this result:&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="Capture.PNG" style="width: 369px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26511i72DA5389558D9095/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How can I do this so that the color for 11 year olds is the same on each plot, and the color for 12 year olds is the same on each plot,&amp;nbsp;&lt;EM&gt;etc&lt;/EM&gt;.?&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jan 2019 14:34:09 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-01-23T14:34:09Z</dc:date>
    <item>
      <title>PROC SGPLOT VBOX — how to get consistent colors across the BY groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529393#M17694</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
	by sex;
run;
proc sgplot data=class;
styleattrs;
	by sex;
    vbox height/group=age grouporder=ascending;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;produces this result:&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="Capture.PNG" style="width: 369px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26511i72DA5389558D9095/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How can I do this so that the color for 11 year olds is the same on each plot, and the color for 12 year olds is the same on each plot,&amp;nbsp;&lt;EM&gt;etc&lt;/EM&gt;.?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 14:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529393#M17694</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-23T14:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT VBOX — how to get consistent colors across the BY groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529457#M17695</link>
      <description>&lt;P&gt;Just use a discrete attributes map, like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
	by sex;
run;

data attrmap;
retain id "myid" linecolor "black";
length fillcolor $ 6;
input value $ fillcolor $;
cards;
11 orange
12 purple
13 green
14 blue
15 red
16 gold
;
run;

proc sgplot data=class dattrmap=attrmap;
  by sex;
  vbox height/group=age attrid=myid grouporder=ascending;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 17:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529457#M17695</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-01-23T17:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT VBOX — how to get consistent colors across the BY groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529476#M17696</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;&amp;nbsp;, I have used discrete attribute maps in the past and totally forgot about them. But this works!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 18:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529476#M17696</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-23T18:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT VBOX — how to get consistent colors across the BY groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529538#M17697</link>
      <description>&lt;P&gt;If your group variable within levels of the by variable have the same minimum and the same values except for possibly max then a modification to sort works:&lt;/P&gt;
&lt;PRE&gt;proc sort data=sashelp.class out=class;
	by sex age;
run;

proc sgplot data=class;
styleattrs;
	by sex;
    vbox height/group=age grouporder=ascending;
run;
&lt;/PRE&gt;
&lt;P&gt;but when there are differing gaps in the values of the group variable the color no longer aligns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 20:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-VBOX-how-to-get-consistent-colors-across-the-BY/m-p/529538#M17697</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-01-23T20:47:40Z</dc:date>
    </item>
  </channel>
</rss>

