<?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: How do I change symbols and colors in Proc SGPLOT (swimmer plot) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907975#M358374</link>
    <description>&lt;P&gt;Thank you so much Bart!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I overlooked this.. And also I noticed my attrmap variables were named wrong. Markerfillcolor and markercolor instead of what I used fillcolor and color. Thanks so much!&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 08:02:36 GMT</pubDate>
    <dc:creator>JohanK</dc:creator>
    <dc:date>2023-12-14T08:02:36Z</dc:date>
    <item>
      <title>How do I change symbols and colors in Proc SGPLOT (swimmer plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907755#M358324</link>
      <description>&lt;P&gt;I have prepared a dataset for a swimmer plot.&lt;BR /&gt;I want to change the color of the symbols for responders (partial response, progression and Complete remission (CR)), and also the symbol and color for 'No response'.&lt;BR /&gt;I have included the dataset as an Excel file , txt file as well my code and output&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data attrmap;
retain id "status";
  input 
        @1 value $ 1-40
        @42 fillcolor $7.
		@50 color $7.
        @57 markersymbol $4.;
  datalines ;
Complete remission (CR)                  yellow  yellow starfilled 
partial response   						 green   green  starfilled 
progression 							 blue	 blue   starfilled;
run;

proc sgplot data = testfile dattrmap = attrmap; 
  highlow y=usubjid low=low high=high / highcap=highcap HIGHLABEL=USUBJID  type=bar group=cohort fill nooutline
          lineattrs=(color=black) name='cohort' /*nomissinggroup*/ transparency=0.3;
  scatter y=usubjid x=start / markerattrs=(symbol=trianglefilled size=10 /*color=grey*/) name='s' group=status ; 
  scatter y=usubjid x=start / markerattrs=(symbol=starfilled size=14) group=status attrid=status;
  YAXIS LABEL='Subject ID' DISPLAY=(NOTICKS NOVALUES);
  yaxis reverse display=(noticks novalues noline) label='Subjects Received Study Drug' min=1;
  keylegend 'Cohort' / title='Cohort';
  keylegend 'status' 's'  / noborder location=inside position=bottomright across=1;
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot77.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/91250iDFA9450028AC4E36/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot77.png" alt="SGPlot77.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;It seems I do something wroing with the attrmap and connecting it to the sgplot program.&lt;BR /&gt;Can someone help me? Thanks so much!!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 14:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907755#M358324</guid>
      <dc:creator>JohanK</dc:creator>
      <dc:date>2023-12-13T14:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change symbols and colors in Proc SGPLOT (swimmer plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907760#M358329</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;progression 							 blue	 blue   starfilled;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try it with no semi-colon at the end&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 14:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907760#M358329</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-13T14:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change symbols and colors in Proc SGPLOT (swimmer plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907767#M358330</link>
      <description>&lt;P&gt;Do you mean like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testfile;
infile cards dlm="|" missover;
input 
Obs START USUBJID : $ 12. Cohort HIGH LOW STATUS : $ 32. YMIN DURABLE HIGHCAP : $ 20.;
cards;
1 |22|101-001|1|57 |1|No response|-15|.|  
2 |61|101-001|1|57 |1|No response|-15|.|  
3 |22|101-002|2|91 |1|No response|-15|.|  
4 |70|101-002|2|91 |1|No response|-15|.|  
5 |98|101-002|2|91 |1|No response|-15|.|  
6 |28|101-003|3|54 |1|No response|-15|.|  
7 |57|101-003|3|54 |1|No response|-15|.|  
8 |50|202-001|3|98 |1|partial response|-15|-2|  
9 |29|101-005|4|50 |1|No response|-15|.|  
10|55|101-005|4|50 |1|No response|-15|.|  
11|28|202-002|4|119|1|progression|-15|-2|FilledArrow 
12|56|202-002|4|119|1|Complete remission (CR)|-15|-2|FilledArrow 
13|26|202-003|4|35 |1|No response|-15|.|  
14|26|301-001|4|77 |1|No response|-15|.|  
15|56|301-001|4|77 |1|No response|-15|.|  
16|91|301-001|4|77 |1|No response|-15|.|  
17|27|501-002|4|22 |1|No response|-15|.|  
18|27|501-003|4|22 |1|No response|-15|.|  
19|40|101-006|5|50 |1|No response|-15|.|FilledArrow 
20|19|102-003|5|15 |1|No response|-15|.|  
21|28|202-004|5|35 |1|No response|-15|.|FilledArrow 
22|22|301-002|5|28 |1|partial response|-15|-2|FilledArrow 
23|31|301-003|5|24 |1|No response|-15|.|FilledArrow 
;
run;

data attrmap;
retain id "status";
infile cards dlm=",";
  input 
        value : $ 32.
        markerfillcolor : $ 7.
		    markercolor :$ 7.
        markersymbol : $ 4.;
datalines ;
Complete remission (CR),yellow,yellow,starfilled 
partial response,green,green,starfilled
progression,blue,blue,starfilled
No response,red,red,starfilled
;
run;

proc sgplot data = testfile dattrmap = attrmap; 
  highlow y=usubjid low=low high=high / highcap=highcap HIGHLABEL=USUBJID  type=bar group=cohort fill nooutline
          lineattrs=(color=black) name='cohort' /*nomissinggroup*/ transparency=0.3;
  scatter y=usubjid x=start / markerattrs=(symbol=trianglefilled size=10 /*color=grey*/) name='s' group=status ; 
  scatter y=usubjid x=start / markerattrs=(symbol=starfilled size=14) group=status attrid=status;
  YAXIS LABEL='Subject ID' DISPLAY=(NOTICKS NOVALUES);
  yaxis reverse display=(noticks novalues noline) label='Subjects Received Study Drug' min=1;
  keylegend 'Cohort' / title='Cohort';
  keylegend 'status' 's'  / noborder location=inside position=bottomright across=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1702479820469.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/91251iE1B64B1221F1F43D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1702479820469.png" alt="yabwon_0-1702479820469.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 15:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907767#M358330</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-13T15:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change symbols and colors in Proc SGPLOT (swimmer plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907975#M358374</link>
      <description>&lt;P&gt;Thank you so much Bart!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I overlooked this.. And also I noticed my attrmap variables were named wrong. Markerfillcolor and markercolor instead of what I used fillcolor and color. Thanks so much!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 08:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907975#M358374</guid>
      <dc:creator>JohanK</dc:creator>
      <dc:date>2023-12-14T08:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I change symbols and colors in Proc SGPLOT (swimmer plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907976#M358375</link>
      <description>&lt;P&gt;Glad I could help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a "gazilion" of those options. easy to skip some of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 08:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-change-symbols-and-colors-in-Proc-SGPLOT-swimmer-plot/m-p/907976#M358375</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-14T08:07:21Z</dc:date>
    </item>
  </channel>
</rss>

