<?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: Swimmer's plot, how to show dose level and text inside the bars in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/806991#M318057</link>
    <description>&lt;P&gt;If you want to display text on many plots then a TEXT plot is the starting point.&lt;/P&gt;
&lt;PRE&gt;PROC SGPLOT DATA=SWIMMER1; 
   HIGHLOW Y=ORDER LOW=TRTSTDY HIGH=TRTENDY / LOWLABEL=SUBJID TYPE=BAR 
      HIGHCAP=TRTCAP name='hl'; 
   text x=TRTENDY y=order text=TUMOR_HISTOLOGY 
            / position=left /*places text just left of coordinate*/
   ;
   XAXIS LABEL='Study Day' VALUES=(0 TO 120 BY 30);
   YAXIS LABEL='Subject ID' DISPLAY=(NOTICKS NOVALUES);
   keylegend 'hl';
RUN; &lt;/PRE&gt;
&lt;P&gt;You may want to provide a different horizontal coordinate variable if the values are too close to the end of the bar or you want to move them from the arrow portions.&lt;/P&gt;</description>
    <pubDate>Sun, 10 Apr 2022 06:58:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-04-10T06:58:49Z</dc:date>
    <item>
      <title>Swimmer's plot, how to show dose level and text inside the bars</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/806964#M318040</link>
      <description>&lt;P&gt;Hi folks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this swimmer's plot, I'd like to show "dose levels" and "short texts" indicating histology of tumors inside the bars. Desirable image is shown below that I manually created in photoshop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SWIMMER PLOT DL AND TEXTS IN THE BAR.png" style="width: 686px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70281iCFE41F553E097AF1/image-size/large?v=v2&amp;amp;px=999" role="button" title="SWIMMER PLOT DL AND TEXTS IN THE BAR.png" alt="SWIMMER PLOT DL AND TEXTS IN THE BAR.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Dataset and initial proc sgplot is following. Can you please help add these details to the plot?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA SWIMMER1;
infile datalines dsd;
informat TRTCAP $12.;
INPUT SUBJID $ TRTSTDY TRTENDY ORDER TRTCAP $ DOSE_LEVEL $ TUMOR_HISTOLOGY $;
DATALINES;
24,1,28,1,,DL-2,TEXT1  
29,1,28,2,,DL-2,TEXT2  
20,1,28,3,,DL-2,TEXT3
21,1,29,4,,DL-2,TEXT3  
19,1,70,5,,DL-2,TEXT3  
22,1,91,6,,DL-2,TEXT3  
25,1,91,7,FilledArrow,DL-2,TEXT3
27,1,91,8,FilledArrow,DL-2,TEXT3
10,1,117,9,,DL-2,TEXT3
;
PROC PRINT; RUN; 
PROC SGPLOT DATA=SWIMMER1; 
HIGHLOW Y=ORDER LOW=TRTSTDY HIGH=TRTENDY / LOWLABEL=SUBJID TYPE=BAR 
HIGHCAP=TRTCAP; 
XAXIS LABEL='Study Day' VALUES=(0 TO 120 BY 30);
YAXIS LABEL='Subject ID' DISPLAY=(NOTICKS NOVALUES);
RUN; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Thank you for your time in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 23:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/806964#M318040</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2022-04-09T23:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Swimmer's plot, how to show dose level and text inside the bars</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/806991#M318057</link>
      <description>&lt;P&gt;If you want to display text on many plots then a TEXT plot is the starting point.&lt;/P&gt;
&lt;PRE&gt;PROC SGPLOT DATA=SWIMMER1; 
   HIGHLOW Y=ORDER LOW=TRTSTDY HIGH=TRTENDY / LOWLABEL=SUBJID TYPE=BAR 
      HIGHCAP=TRTCAP name='hl'; 
   text x=TRTENDY y=order text=TUMOR_HISTOLOGY 
            / position=left /*places text just left of coordinate*/
   ;
   XAXIS LABEL='Study Day' VALUES=(0 TO 120 BY 30);
   YAXIS LABEL='Subject ID' DISPLAY=(NOTICKS NOVALUES);
   keylegend 'hl';
RUN; &lt;/PRE&gt;
&lt;P&gt;You may want to provide a different horizontal coordinate variable if the values are too close to the end of the bar or you want to move them from the arrow portions.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2022 06:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/806991#M318057</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-10T06:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Swimmer's plot, how to show dose level and text inside the bars</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/807037#M318083</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; thank you so much. Do you have any suggestions how to place Dose Levels in the beginning of each bar?</description>
      <pubDate>Sun, 10 Apr 2022 15:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/807037#M318083</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2022-04-10T15:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Swimmer's plot, how to show dose level and text inside the bars</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/807078#M318112</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; thank you so much. Do you have any suggestions how to place Dose Levels in the beginning of each bar?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You would provide an x coordinate for the LOW end of your highlow ploat and use the Position=Right so the text appears right of that coordinate:&lt;/P&gt;
&lt;PRE&gt;PROC SGPLOT DATA=SWIMMER1; 
HIGHLOW Y=ORDER LOW=TRTSTDY HIGH=TRTENDY / LOWLABEL=SUBJID TYPE=BAR 
HIGHCAP=TRTCAP; 
text x=trtstdy y=order text=TUMOR_HISTOLOGY / position=right;
XAXIS LABEL='Study Day' VALUES=(0 TO 120 BY 30);
YAXIS LABEL='Subject ID' DISPLAY=(NOTICKS NOVALUES);
RUN; &lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Apr 2022 02:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Swimmer-s-plot-how-to-show-dose-level-and-text-inside-the-bars/m-p/807078#M318112</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-11T02:02:19Z</dc:date>
    </item>
  </channel>
</rss>

