<?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 How to fulfill the superscript text in the legend in the sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/665094#M20139</link>
    <description>&lt;P&gt;The sas code is in the program.jpg and the Expect results in the result.jpg, Many thanks in advance~&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jun 2020 17:42:24 GMT</pubDate>
    <dc:creator>Charles_Liu</dc:creator>
    <dc:date>2020-06-25T17:42:24Z</dc:date>
    <item>
      <title>How to fulfill the superscript text in the legend in the sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/665094#M20139</link>
      <description>&lt;P&gt;The sas code is in the program.jpg and the Expect results in the result.jpg, Many thanks in advance~&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 17:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/665094#M20139</guid>
      <dc:creator>Charles_Liu</dc:creator>
      <dc:date>2020-06-25T17:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to fulfill the superscript text in the legend in the sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/665099#M20140</link>
      <description>&lt;P&gt;some reference&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Program.JPG" style="width: 835px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/46667i545559E5068D78CF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Program.JPG" alt="Program.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Result.JPG" style="width: 738px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/46666i82D2AB29889E515B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Result.JPG" alt="Result.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 17:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/665099#M20140</guid>
      <dc:creator>Charles_Liu</dc:creator>
      <dc:date>2020-06-25T17:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to fulfill the superscript text in the legend in the sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/666050#M20149</link>
      <description>&lt;P&gt;I'm not 100% sure, but I don't think unicode characacters are supported in the legend, directly, the way your code is trying (it would be nice/convenient if it worked that way, but I've tried it a few different ways and can't get it to work).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I did get it to work a slightly different way ... rather than using a single series statement, with the group= creating 2 lines, you can create a separate variable for each line, and and then specify the unicode character in the 'legendlabel=' for each line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've mocked-up some data similar to yours to demonstrate...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data final;&lt;BR /&gt;input dosegp_ aval p1;&lt;BR /&gt;datalines;&lt;BR /&gt;16 0 0&lt;BR /&gt;16 1 0&lt;BR /&gt;16 1.8 0&lt;BR /&gt;16 1.8 5&lt;BR /&gt;16 1.8 10&lt;BR /&gt;16 1.8 27&lt;BR /&gt;16 1.9 69&lt;BR /&gt;16 3.9 69&lt;BR /&gt;16 4 90&lt;BR /&gt;16 22 90&lt;BR /&gt;20 0 0&lt;BR /&gt;20 .5 0&lt;BR /&gt;20 .5 11&lt;BR /&gt;20 1.8 11&lt;BR /&gt;20 1.8 44&lt;BR /&gt;20 2.2 44&lt;BR /&gt;20 2.2 62&lt;BR /&gt;20 19 62&lt;BR /&gt;20 19 100&lt;BR /&gt;20 22 100&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* Rather than doing it this way...&lt;BR /&gt;proc sgplot data=final;&lt;BR /&gt;&lt;STRONG&gt;series&lt;/STRONG&gt; x=aval y=p1 / &lt;STRONG&gt;group=&lt;/STRONG&gt;dosegp_;&lt;BR /&gt;run;&lt;BR /&gt;*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* create 2 separate variables to plot */&lt;BR /&gt;data final_mod; set final;&lt;BR /&gt;if dosegp_=16 then &lt;STRONG&gt;p1_16&lt;/STRONG&gt;=p1;&lt;BR /&gt;if dosegp_=20 then &lt;STRONG&gt;p1_20&lt;/STRONG&gt;=p1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;title "Kaplan-Meier";&lt;BR /&gt;footnote "Log-rank P value";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods escapechar='^';proc sgplot data=final_mod;&lt;BR /&gt;&lt;STRONG&gt;series&lt;/STRONG&gt; x=aval y=&lt;STRONG&gt;p1_16&lt;/STRONG&gt; / lineattrs=(color=red thickness=1.5 pattern=shortdash) &lt;BR /&gt;&amp;nbsp; &amp;nbsp;name='line16' &lt;STRONG&gt;legendlabel="16 mg/m^{unicode '00b2'x}"&lt;/STRONG&gt;;&lt;BR /&gt;&lt;STRONG&gt;series&lt;/STRONG&gt; x=aval y=&lt;STRONG&gt;p1_20&lt;/STRONG&gt; / lineattrs=(color=blue thickness=1.5) &lt;BR /&gt;&amp;nbsp; &amp;nbsp;name='line20' &lt;STRONG&gt;legendlabel="20 mg/m^{unicode '00b2'x}"&lt;/STRONG&gt;;&lt;BR /&gt;scatter x=aval y=p1 / markerattrs=(symbol=plus size=7 color=black) &lt;BR /&gt;&amp;nbsp; &amp;nbsp;name='rp' legendlabel="Censor";&lt;BR /&gt;keylegend 'line16' 'line20' 'rp' / location=outside down=1 position=bottom;&lt;BR /&gt;yaxis label="Response Probability (%)" values=(0 to 100 by 10);&lt;BR /&gt;xaxis label="Time (Months)" values=(0 to 22 by 2);&lt;BR /&gt;run;&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="plot_squared.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/46791iDC469D1E1DA22897/image-size/large?v=v2&amp;amp;px=999" role="button" title="plot_squared.png" alt="plot_squared.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 12:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/666050#M20149</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-06-30T12:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to fulfill the superscript text in the legend in the sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/670352#M20231</link>
      <description>&lt;P&gt;Yes,thanks, I dealt with it in the same way that you did and it worked.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 17:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-fulfill-the-superscript-text-in-the-legend-in-the-sgplot/m-p/670352#M20231</guid>
      <dc:creator>Charles_Liu</dc:creator>
      <dc:date>2020-07-18T17:42:18Z</dc:date>
    </item>
  </channel>
</rss>

