<?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 multiple labels in sgplot (polygon) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/multiple-labels-in-sgplot-polygon/m-p/873308#M345045</link>
    <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;assuming I had this code which plots a sankey chart&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=myplotdata noborder;
        polygon x=x y=y id=id / fill nooutline group=group transparency=0.3 name='p' label=count labelloc=insidebbox ;
        xaxistable nodes / x=x_label location=inside position=top nolabel title="Sankey Chart" valueattrs=(size=12pt) titleattrs=(size=12pt) ;
        xaxis min=0 max=%sysevalf(100+5) values=(0 to 100 by 10) display=none valueshint;
        yaxis min=0 max=100 reverse values=(0 to 100 by 10) display=none;
        keylegend 'p'/ title=" " noborder location=outside position=bottom exclude=('') valueattrs=(size=12pt) titleattrs=(size=12pt);
    run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I&amp;nbsp; am able to label the bar segments with label=count. I will also like to label the nodes leaving the segments (variable=n_move). My question is, is it possible to label using multiple variables (in this case count and n_move) in sgplot?&lt;/P&gt;
&lt;P&gt;if yes, how ?&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="Anita_n_0-1683008164026.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83487i2AE5DADB35B1752E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anita_n_0-1683008164026.png" alt="Anita_n_0-1683008164026.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The red arrow indicates label=count&amp;nbsp; and the blue arrow indicates label=n_move showing the number of patients leaving that group&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 06:37:03 GMT</pubDate>
    <dc:creator>Anita_n</dc:creator>
    <dc:date>2023-05-02T06:37:03Z</dc:date>
    <item>
      <title>multiple labels in sgplot (polygon)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-labels-in-sgplot-polygon/m-p/873308#M345045</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;assuming I had this code which plots a sankey chart&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=myplotdata noborder;
        polygon x=x y=y id=id / fill nooutline group=group transparency=0.3 name='p' label=count labelloc=insidebbox ;
        xaxistable nodes / x=x_label location=inside position=top nolabel title="Sankey Chart" valueattrs=(size=12pt) titleattrs=(size=12pt) ;
        xaxis min=0 max=%sysevalf(100+5) values=(0 to 100 by 10) display=none valueshint;
        yaxis min=0 max=100 reverse values=(0 to 100 by 10) display=none;
        keylegend 'p'/ title=" " noborder location=outside position=bottom exclude=('') valueattrs=(size=12pt) titleattrs=(size=12pt);
    run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I&amp;nbsp; am able to label the bar segments with label=count. I will also like to label the nodes leaving the segments (variable=n_move). My question is, is it possible to label using multiple variables (in this case count and n_move) in sgplot?&lt;/P&gt;
&lt;P&gt;if yes, how ?&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="Anita_n_0-1683008164026.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83487i2AE5DADB35B1752E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anita_n_0-1683008164026.png" alt="Anita_n_0-1683008164026.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The red arrow indicates label=count&amp;nbsp; and the blue arrow indicates label=n_move showing the number of patients leaving that group&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 06:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-labels-in-sgplot-polygon/m-p/873308#M345045</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2023-05-02T06:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: multiple labels in sgplot (polygon)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-labels-in-sgplot-polygon/m-p/873316#M345050</link>
      <description>&lt;P&gt;If you have x, y coordinates associated where you want the label placed a TEXT plot would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or provide data so we can run your code and see what might be possible. Sometimes these extra label steps are easy, sometimes you need to add variables or rearrange data a bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try duplicating your plot statement with a the label changed to the other variable. If that obscures your plot too much try turning the transparency up in BOTH ploygon statements as the overlaps will get more saturation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you are making this a relatively large graphic as you are going to have a lot of text floating around, likely with collisions. Are you sure that you want those skinny connections with text?&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 08:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-labels-in-sgplot-polygon/m-p/873316#M345050</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-02T08:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: multiple labels in sgplot (polygon)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/multiple-labels-in-sgplot-polygon/m-p/873361#M345073</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Thankyou, I will try that&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/multiple-labels-in-sgplot-polygon/m-p/873361#M345073</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2023-05-02T13:16:58Z</dc:date>
    </item>
  </channel>
</rss>

