<?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: different symbol-colors for by-variable subgroups in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45057#M1488</link>
    <description>Sorry, but you can't assign line colors, etc, like that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
With gplot, you set up the symbol statements with a number (n), such as symbol1 - symboln...&lt;BR /&gt;
&lt;BR /&gt;
symbol1 v=plus ci=black i=join;&lt;BR /&gt;
symbol2 v=plus ci=green i=join;&lt;BR /&gt;
symbol3 v=plus ci=red i=join;&lt;BR /&gt;
symbol4 v=plus ci=blue i=join;&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data=foo;&lt;BR /&gt;
plot y*x=by-Variable;&lt;BR /&gt;
&lt;BR /&gt;
Then the values of by-Variable (or whatever the variable name you use) are assigned to the symbol statements, in alpha/numeric order (there are a few caveats &amp;amp; tricks, but I won't get into them unless you bump into the problems that would require them!)</description>
    <pubDate>Wed, 07 Jul 2010 12:12:51 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2010-07-07T12:12:51Z</dc:date>
    <item>
      <title>different symbol-colors for by-variable subgroups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45056#M1487</link>
      <description>hi,&lt;BR /&gt;
&lt;BR /&gt;
i did some series-plots with proc gplot and would like to change the color of the lines in dependency of the by-Variable value. &lt;BR /&gt;
&lt;BR /&gt;
Like:&lt;BR /&gt;
&lt;BR /&gt;
IF by-Variable  EQ 'P01' THEN DO; symbol v=plus ci=black i=join;	END;&lt;BR /&gt;
ELSE IF by-Variable EQ 'P02' THEN DO; symbol v=plus ci=green i=join;END;&lt;BR /&gt;
ELSE IF by-Variable EQ 'P02' THEN DO; symbol v=plus ci=red i=join;END;&lt;BR /&gt;
ELSE IF by-Variable EQ 'P02' THEN DO; symbol v=plus ci=blue i=join;END;&lt;BR /&gt;
&lt;BR /&gt;
Is that possible? And when yes, how? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
thank you for answers! Marie</description>
      <pubDate>Wed, 07 Jul 2010 09:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45056#M1487</guid>
      <dc:creator>marieK</dc:creator>
      <dc:date>2010-07-07T09:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: different symbol-colors for by-variable subgroups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45057#M1488</link>
      <description>Sorry, but you can't assign line colors, etc, like that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
With gplot, you set up the symbol statements with a number (n), such as symbol1 - symboln...&lt;BR /&gt;
&lt;BR /&gt;
symbol1 v=plus ci=black i=join;&lt;BR /&gt;
symbol2 v=plus ci=green i=join;&lt;BR /&gt;
symbol3 v=plus ci=red i=join;&lt;BR /&gt;
symbol4 v=plus ci=blue i=join;&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data=foo;&lt;BR /&gt;
plot y*x=by-Variable;&lt;BR /&gt;
&lt;BR /&gt;
Then the values of by-Variable (or whatever the variable name you use) are assigned to the symbol statements, in alpha/numeric order (there are a few caveats &amp;amp; tricks, but I won't get into them unless you bump into the problems that would require them!)</description>
      <pubDate>Wed, 07 Jul 2010 12:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45057#M1488</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-07-07T12:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: different symbol-colors for by-variable subgroups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45058#M1489</link>
      <description>thank you! But when i do a*b=by-variable then i get an overlay-Graph. And that i dont want &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Any other idea?

Message was edited by: marieK</description>
      <pubDate>Thu, 08 Jul 2010 08:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45058#M1489</guid>
      <dc:creator>marieK</dc:creator>
      <dc:date>2010-07-08T08:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: different symbol-colors for by-variable subgroups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45059#M1490</link>
      <description>Hey Marie,&lt;BR /&gt;
&lt;BR /&gt;
Because you have SAS 9.2, there is another way you can approach this graph. The Graph Template Language (GTL) supports the concept of "style indexing". You can put your attributes into the style and add an index in your data to reference those style attributes. This index variable is specified on the GTL plot statements where supported. Here is a simple example:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
/* Create a new style from the listing */&lt;BR /&gt;
/* style using my attributes */&lt;BR /&gt;
proc template;&lt;BR /&gt;
define style styles.mystyle;&lt;BR /&gt;
parent=styles.listing;&lt;BR /&gt;
style graphdata1 from graphdata1 /&lt;BR /&gt;
   contrastcolor = orange&lt;BR /&gt;
   linestyle=1;&lt;BR /&gt;
style graphdata2 from graphdata2 /&lt;BR /&gt;
   contrastcolor = purple&lt;BR /&gt;
   linestyle=1;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/* Tell the LISTING destination */&lt;BR /&gt;
/* to use my new style */&lt;BR /&gt;
ods listing style=mystyle; &lt;BR /&gt;
&lt;BR /&gt;
/* Add the style indexing to my data */&lt;BR /&gt;
data mydata;&lt;BR /&gt;
set sashelp.class;&lt;BR /&gt;
if (sex="M") then index=1;&lt;BR /&gt;
if (sex="F") then index=2;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/* Sort the data by the BY-group variable */&lt;BR /&gt;
proc sort data=mydata; by sex; run;&lt;BR /&gt;
&lt;BR /&gt;
/* Define the series plot */&lt;BR /&gt;
proc template;&lt;BR /&gt;
define statgraph series;&lt;BR /&gt;
begingraph;&lt;BR /&gt;
layout overlay;&lt;BR /&gt;
  seriesplot x=weight y=height / group=sex index=index;&lt;BR /&gt;
endlayout;&lt;BR /&gt;
endgraph;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/* Render the graph */&lt;BR /&gt;
proc sgrender data=mydata template=series; &lt;BR /&gt;
by sex;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 08 Jul 2010 19:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45059#M1490</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-07-08T19:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: different symbol-colors for by-variable subgroups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45060#M1491</link>
      <description>Hi Dan,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
thanks for your tip! I will try it the next days!</description>
      <pubDate>Fri, 09 Jul 2010 08:03:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45060#M1491</guid>
      <dc:creator>marieK</dc:creator>
      <dc:date>2010-07-09T08:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: different symbol-colors for by-variable subgroups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45061#M1492</link>
      <description>A paper that relates to the association of variables to SYMBOL statements can be found at:&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi29/086-29.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi29/086-29.pdf&lt;/A&gt;</description>
      <pubDate>Sat, 17 Jul 2010 23:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/different-symbol-colors-for-by-variable-subgroups/m-p/45061#M1492</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-07-17T23:15:40Z</dc:date>
    </item>
  </channel>
</rss>

