<?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 Using macros to test different colors combinations for sgplot? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-macros-to-test-different-colors-combinations-for-sgplot/m-p/339742#M77543</link>
    <description>&lt;P&gt;Hi SAS community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about generating different color combinations for the sgplot. I know it might sound silly but it could really help me a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The task is like that:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data= test;
series y=year x=banana /  lineattrs=(color=Red pattern=dot)
                          markerattrs=(color=Red symbol=circlefilled);
series y=year x=strawberry /  lineattrs=(color=black pattern=dot)
                          markerattrs=(color=black symbol=circlefilled);
series y=year x=grape /  lineattrs=(color=blue pattern=dot)
                          markerattrs=(color=blue symbol=circlefilled);
title	"production of fruit by year";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The plot draws several series of lines,&lt;/P&gt;&lt;P&gt;and I JUST want to test for the color of banana line first, with color of red, then green , then blue, etc.etc, as well as the patterns...&lt;/P&gt;&lt;P&gt;I've tried %array and % do_over but cannot make it work...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2017 19:04:33 GMT</pubDate>
    <dc:creator>joseph626</dc:creator>
    <dc:date>2017-03-09T19:04:33Z</dc:date>
    <item>
      <title>Using macros to test different colors combinations for sgplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-macros-to-test-different-colors-combinations-for-sgplot/m-p/339742#M77543</link>
      <description>&lt;P&gt;Hi SAS community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about generating different color combinations for the sgplot. I know it might sound silly but it could really help me a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The task is like that:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data= test;
series y=year x=banana /  lineattrs=(color=Red pattern=dot)
                          markerattrs=(color=Red symbol=circlefilled);
series y=year x=strawberry /  lineattrs=(color=black pattern=dot)
                          markerattrs=(color=black symbol=circlefilled);
series y=year x=grape /  lineattrs=(color=blue pattern=dot)
                          markerattrs=(color=blue symbol=circlefilled);
title	"production of fruit by year";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The plot draws several series of lines,&lt;/P&gt;&lt;P&gt;and I JUST want to test for the color of banana line first, with color of red, then green , then blue, etc.etc, as well as the patterns...&lt;/P&gt;&lt;P&gt;I've tried %array and % do_over but cannot make it work...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 19:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-macros-to-test-different-colors-combinations-for-sgplot/m-p/339742#M77543</guid>
      <dc:creator>joseph626</dc:creator>
      <dc:date>2017-03-09T19:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using macros to test different colors combinations for sgplot?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-macros-to-test-different-colors-combinations-for-sgplot/m-p/339749#M77544</link>
      <description>&lt;P&gt;1) Next is a documnentation of available color names in sas:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/publishing/authors/extras/62007_Appendix.pdf" target="_self"&gt;http://support.sas.com/publishing/authors/extras/62007_Appendix.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) You can run your code with a macro, suplying the color names to check:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro check_colors(colr1, colr2, colr3)
   proc sgplot data= test;
     series y=year x=banana /  lineattrs=(color=&amp;amp;colr1 pattern=dot)
                          markerattrs=(color=&amp;amp;colr1 symbol=circlefilled);
     series y=year x=strawberry /  lineattrs=(color=&amp;amp;colr2 pattern=dot)
                          markerattrs=(color=&amp;amp;colr2 symbol=circlefilled);
     series y=year x=grape /  lineattrs=(color=&amp;amp;colr3 pattern=dot)
                          markerattrs=(color=&amp;amp;colr3 symbol=circlefilled);
     title	"production of fruit by year";
  run;
%mend check_colors;
%check_colors(red, black, blue);  /* replace by any other set of 3 color names */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 19:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-macros-to-test-different-colors-combinations-for-sgplot/m-p/339749#M77544</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-03-09T19:25:17Z</dc:date>
    </item>
  </channel>
</rss>

