<?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 sgplot: change group colour and line style in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829830#M23099</link>
    <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing a survival curve using proc sgplot and the group statement. I have a total of 8 groups. I need some of the groups to have dotted lines and some of them to have full lines and specify every groups colour.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to put it into the following code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sgplot data=abc2;
series x=weeks y=SURVIVAL1 /group = exp_event;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 10:36:12 GMT</pubDate>
    <dc:creator>lone0708</dc:creator>
    <dc:date>2022-08-23T10:36:12Z</dc:date>
    <item>
      <title>sgplot: change group colour and line style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829830#M23099</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing a survival curve using proc sgplot and the group statement. I have a total of 8 groups. I need some of the groups to have dotted lines and some of them to have full lines and specify every groups colour.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to put it into the following code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sgplot data=abc2;
series x=weeks y=SURVIVAL1 /group = exp_event;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 10:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829830#M23099</guid>
      <dc:creator>lone0708</dc:creator>
      <dc:date>2022-08-23T10:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot: change group colour and line style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829832#M23100</link>
      <description>&lt;P&gt;For full control of the attributes try a &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p18q268a3zxcl3n11lnnnq4cme8r.htm" target="_self"&gt;Discrete Attribute Map&lt;/A&gt; .&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 10:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829832#M23100</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-08-23T10:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot: change group colour and line style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829833#M23101</link>
      <description>&lt;P&gt;You can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1dt33l6a6epk6n1chtynsgsjgit.htm#p16hih94ibd2xnn16z35no4tn01n" target="_self"&gt;STYLEATTRS command&lt;/A&gt; in PROC SGPLOT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;styleattrs datacontrastcolors=(orange cyan CXFF0000) 	
    datalinepatterns=(dot solid longdash 26);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Experiment to find what works for you.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 10:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829833#M23101</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-23T10:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot: change group colour and line style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829915#M23103</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;is correct. You' will want to use an attributes map. Here is a simple example using a SERIES plot below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data attrmap;
retain ID "myid" nocase "true";
input value $ linecolor $ linepattern $;
cards;
F   pink   solid
M   blue   dash
;
run;

proc sgplot data=sashelp.class dattrmap=attrmap;
series x=name y=weight / group=sex attrid=myid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Aug 2022 15:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829915#M23103</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2022-08-23T15:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot: change group colour and line style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829989#M23104</link>
      <description>&lt;P&gt;Thank you for your answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;I have tried to make the attribute map (please see attatched photo), but the colours are not at all corresponding. Do i miss something in the code?&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="lone0708_0-1661283909518.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74647i713952C4EAE29D64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lone0708_0-1661283909518.png" alt="lone0708_0-1661283909518.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 19:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829989#M23104</guid>
      <dc:creator>lone0708</dc:creator>
      <dc:date>2022-08-23T19:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot: change group colour and line style</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829995#M23105</link>
      <description>&lt;P&gt;The column names in an attributes map are reserved keywords, so they must be spelled as they are expected. In your screenshot, you have spelled the expected "fillcolor" with the alternate "fillcolour" spelling. Also, for a series plot, you should be using "linecolor" instead of "fillcolor".&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 20:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-change-group-colour-and-line-style/m-p/829995#M23105</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2022-08-23T20:05:53Z</dc:date>
    </item>
  </channel>
</rss>

