<?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: Controlling order of group attributes in SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457123#M15721</link>
    <description>&lt;P&gt;You need to ensure that the attributes you address are valid for the plot type:&lt;/P&gt;
&lt;PRE&gt;data myattrmap;
length markersymbol $20;
input ID $ value $ markercolor  $ markersymbol $;
datalines;
myid  Odd  blue circle
myid  Even green  trianglefilled
;
run;

proc sgplot data=test dattrmap=myattrmap;
  format country  test.;
  scatter x=x y=y /group=country markerattrs=(size=12) attrid=myid;
run;
proc sgplot data=test (where=(flag)) dattrmap=myattrmap;
  format country  test.;
  scatter x=x y=y /group=country markerattrs=(size=12) attrid=myid ;

run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fillcolor is more for VBAR and LINECOLOR is for SERIES (which with your data overlay).&lt;/P&gt;
&lt;P&gt;The attributes for SCATTER are generally all markerxxxxxxx Such as markersize. If you want a filled symbol you need to specify one that is filled (TRIANGLEFILLED) which will then use the marker color for the fill. Note that you need to make the length of the text variables long enough to hold the text to describe them. The default you used was 8 and could not hold any of the filled symbol names.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Apr 2018 23:40:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-04-24T23:40:09Z</dc:date>
    <item>
      <title>Controlling order of group attributes in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457073#M15718</link>
      <description>&lt;P&gt;Is there a way to tie a group attribute to a formatted value in SGPLOT (a bit like the preloading a format in proc tabulate, I think). In the code example below, I group countries into 'odd' and 'even'. The first plot then represents the odds with blue circle and the evens with a red triangle. In the second plot, one observation is dropped from the data and now the patterns are reversed. Can I code this so that I will get the same pattern for odd and even as my data set changes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data test;
input country  x y flag;
cards;
1 1 2 0
2 2 3 1
3 3 4 1
4 4 5 1
;
proc format;
  value  test 1,3="Odd" 2,4="Even";
proc sgplot data=test;
  format country  test.;
  styleattrs datasymbols=(circlefilled trianglefilled);
  scatter x=x y=y /group=country markerattrs=(size=12) ;
proc sgplot data=test (where=(flag));
  format country  test.;
  styleattrs datasymbols=(circlefilled trianglefilled);
  scatter x=x y=y /group=country markerattrs=(size=12) ;
  run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 21:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457073#M15718</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2018-04-24T21:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling order of group attributes in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457077#M15719</link>
      <description>&lt;P&gt;Yes, look into attribute maps:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n18szqcwir8q2nn10od9hhdh2ksj.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=n18szqcwir8q2nn10od9hhdh2ksj.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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 21:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457077#M15719</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-24T21:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling order of group attributes in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457100#M15720</link>
      <description>&lt;P&gt;Thanks for the suggestion. That does seem to be the way to go. However, in my new code below, the attribute map doesn't seem to have any impact (no error is given either).&lt;/P&gt;&lt;PRE&gt;data test;
input country  x y flag;
cards;
1 1 2 0
2 2 3 1
3 3 4 1
4 4 5 1
;
proc format;
  value  test 1,3="Odd" 2,4="Even";
data myattrmap;
input ID $ value $ linecolor $ fillcolor $ symbol $;
datalines;
myid  Odd  blue blue circle
myid  Even green green triangle
;
run;

proc sgplot data=test dattrmap=myattrmap;
  format country  test.;
  scatter x=x y=y /group=country markerattrs=(size=12) attrid=myid;
run;
proc sgplot data=test (where=(flag)) dattrmap=myattrmap;
  format country  test.;
  scatter x=x y=y /group=country markerattrs=(size=12) attrid=myid ;
  run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Apr 2018 22:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457100#M15720</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2018-04-24T22:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling order of group attributes in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457123#M15721</link>
      <description>&lt;P&gt;You need to ensure that the attributes you address are valid for the plot type:&lt;/P&gt;
&lt;PRE&gt;data myattrmap;
length markersymbol $20;
input ID $ value $ markercolor  $ markersymbol $;
datalines;
myid  Odd  blue circle
myid  Even green  trianglefilled
;
run;

proc sgplot data=test dattrmap=myattrmap;
  format country  test.;
  scatter x=x y=y /group=country markerattrs=(size=12) attrid=myid;
run;
proc sgplot data=test (where=(flag)) dattrmap=myattrmap;
  format country  test.;
  scatter x=x y=y /group=country markerattrs=(size=12) attrid=myid ;

run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fillcolor is more for VBAR and LINECOLOR is for SERIES (which with your data overlay).&lt;/P&gt;
&lt;P&gt;The attributes for SCATTER are generally all markerxxxxxxx Such as markersize. If you want a filled symbol you need to specify one that is filled (TRIANGLEFILLED) which will then use the marker color for the fill. Note that you need to make the length of the text variables long enough to hold the text to describe them. The default you used was 8 and could not hold any of the filled symbol names.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 23:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457123#M15721</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-24T23:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling order of group attributes in SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457134#M15722</link>
      <description>&lt;P&gt;Make sure group values are correct.&amp;nbsp; Also, for Symbols, be sure to NOT use HTMLBlue style (for HTML destination).&amp;nbsp; Use Listing.&amp;nbsp; Or, set ATTRPRIORITY=none on ODS Graphics statement.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 02:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Controlling-order-of-group-attributes-in-SGPLOT/m-p/457134#M15722</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-04-25T02:12:07Z</dc:date>
    </item>
  </channel>
</rss>

