<?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 Varied Line Color, How to do it?! in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Varied-Line-Color-How-to-do-it/m-p/974700#M25653</link>
    <description>&lt;P&gt;I need generate 3-by-2 plots, which the code below does. BUT also need let the lines are with varied colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are GROUPLC= and&amp;nbsp;styleattrs datacontrastcolors=(red green black orange blue cyan);&amp;nbsp; BUT only for multiple lines within a single plot.&lt;/P&gt;
&lt;P&gt;How to get 3-by-2 plots with controlled/varied colors?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any other PROC is fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _test;
do grp=1 to 6;
	do ind=1 to 100;
		yvalue=sin(ind/10)+grp;
		gx=grp;
		output;
	end;
end;
run;quit;

	ods layout gridded columns=3 rows=2 advance=bygroup;
	proc sgplot data=_test noautolegend uniform=xscale; 
	by grp;
	series x=ind y=yvalue / group=grp lineattrs=( thickness=2 pattern=solid) grouplc=grp ;     
	refline  30/axis=x lineattrs=(color=red thickness=2 pattern=solid); 
	run;
	ods layout end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Sep 2025 02:09:50 GMT</pubDate>
    <dc:creator>hellohere</dc:creator>
    <dc:date>2025-09-10T02:09:50Z</dc:date>
    <item>
      <title>Varied Line Color, How to do it?!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Varied-Line-Color-How-to-do-it/m-p/974700#M25653</link>
      <description>&lt;P&gt;I need generate 3-by-2 plots, which the code below does. BUT also need let the lines are with varied colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are GROUPLC= and&amp;nbsp;styleattrs datacontrastcolors=(red green black orange blue cyan);&amp;nbsp; BUT only for multiple lines within a single plot.&lt;/P&gt;
&lt;P&gt;How to get 3-by-2 plots with controlled/varied colors?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any other PROC is fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _test;
do grp=1 to 6;
	do ind=1 to 100;
		yvalue=sin(ind/10)+grp;
		gx=grp;
		output;
	end;
end;
run;quit;

	ods layout gridded columns=3 rows=2 advance=bygroup;
	proc sgplot data=_test noautolegend uniform=xscale; 
	by grp;
	series x=ind y=yvalue / group=grp lineattrs=( thickness=2 pattern=solid) grouplc=grp ;     
	refline  30/axis=x lineattrs=(color=red thickness=2 pattern=solid); 
	run;
	ods layout end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Sep 2025 02:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Varied-Line-Color-How-to-do-it/m-p/974700#M25653</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-09-10T02:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Varied Line Color, How to do it?!</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Varied-Line-Color-How-to-do-it/m-p/974730#M25657</link>
      <description>&lt;P&gt;I think this could be done by using a discrete attribute map, to map each group value to a color.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _test;
do grp=1 to 6;
	do ind=1 to 100;
		yvalue=sin(ind/10)+grp;
		gx=grp;
		output;
	end;
end;
run;quit;

data mymap ;
  input value  linecolor $10. ;
  retain id "grp" ;
  cards ;
1 Red
2 Blue
3 Yellow
4 Green
5 Purple
6 Black
;

ods layout gridded columns=3 rows=2 advance=bygroup;
proc sgplot data=_test noautolegend uniform=xscale dattrmap=mymap; 
  by grp;
  series x=ind y=yvalue / group=grp lineattrs=( thickness=2 pattern=solid) attrid=grp;     
  refline  30/axis=x lineattrs=(color=red thickness=2 pattern=solid); 
run;
ods layout end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 12:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Varied-Line-Color-How-to-do-it/m-p/974730#M25657</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-09-10T12:42:53Z</dc:date>
    </item>
  </channel>
</rss>

