<?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 superscript in data label in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/superscript-in-data-label/m-p/693048#M20585</link>
    <description>&lt;P&gt;I am trying to create a plot with data labels on specific points, with 10^-7 displayed in the data label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA D_DailyDataForPub;
    SET D_DailyDataForPub;
    IF Date EQ '17OCT2020'D THEN DO;
/* I tried using superscript, but it did not work: */
/*&lt;BR /&gt;        MaxLabelGE=CATX(" ","17 Oct:",PUT(_g_11dfx5ynpb_GTExt_2020_10_20,8.1),CATT("x 10","(*ESC*){super -7}"));
        MaxLabelCR=CATX(" ","17 Oct:",PUT(_g_NZCR__GTExt_2020_10_20     ,8.1),CATT("x 10","(*ESC*){super -7}"));    
        MaxLabelER=CATX(" ","17 Oct:",PUT(E_R_GTExt_2020_10_20          ,8.1),CATT("x 10","(*ESC*){super -7}"));         
*/
/* Then I tried unicode */
        MaxLabelGE=CATX(" ","17 Oct:",PUT(_g_11dfx5ynpb_GTExt_2020_10_20,8.1),CATT("x 10","(*ESC*){unicode '207B'x}","(*ESC*){unicode '2077'x}"));
        MaxLabelCR=CATX(" ","17 Oct:",PUT(_g_NZCR__GTExt_2020_10_20     ,8.1),CATT("x 10","(*ESC*){unicode '207B'x}","(*ESC*){unicode '2077'x}"));    
        MaxLabelER=CATX(" ","17 Oct:",PUT(E_R_GTExt_2020_10_20          ,8.1),CATT("x 10","(*ESC*){unicode '207B'x}","(*ESC*){unicode '2077'x}"));         
    END;
    ELSE DO;
        MaxLabelGE=" ";
        MaxLabelCR=" ";
        MaxLabelER=" ";
    END;
RUN;
PROC FREQ
    DATA=D_DailyDataForPub;
    TABLE MaxLabel:;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I use proc freq, I get the desired result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Freq: One-Way Frequencies" frame="box" rules="groups" cellspacing="1" cellpadding="7"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;MaxLabelGE&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Percent&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Percent&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;17 Oct: 380861.3 x 10⁻⁷&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;100.00&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;100.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;TFOOT&gt;
&lt;TR&gt;
&lt;TH class="c b footer" colspan="5"&gt;Frequency Missing = 91&lt;/TH&gt;
&lt;/TR&gt;
&lt;/TFOOT&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the plot does not display properly:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT
    NOBORDER
    DATA=D_DailyDataForPub;
    YAXIS LABEL="Log of Raw search probability (x 10(*ESC*){unicode '2077'x})" VALUES=(0 TO 13 BY 1) RANGES=(0-1 5-13);
    XAXIS TYPE=TIME FITPOLICY=SPLIT INTERVAL=Day ;*VALUESFORMAT=DATETIME10.;
    SERIES X=Date Y=LogElection   /DATALABEL=MaxLabelGE;
    SERIES X=Date Y=LogCannabis   /DATALABEL=MaxLabelCR;      
    SERIES X=Date Y=LogEuthanasia /DATALABEL=MaxLabelER;      
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Election and Referendums-log.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50859i8DB033486983D6A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Election and Referendums-log.png" alt="Election and Referendums-log.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that the superscript in the y axis label does work.&lt;/P&gt;
&lt;P&gt;I have looked at:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2011/11/14/the-power-of-unicode/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2011/11/14/the-power-of-unicode/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/24/934.html" target="_blank"&gt;https://support.sas.com/kb/24/934.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/39/267.html" target="_blank"&gt;https://support.sas.com/kb/39/267.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But I can't get this to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2020 23:44:46 GMT</pubDate>
    <dc:creator>JacquesR</dc:creator>
    <dc:date>2020-10-20T23:44:46Z</dc:date>
    <item>
      <title>superscript in data label</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/superscript-in-data-label/m-p/693048#M20585</link>
      <description>&lt;P&gt;I am trying to create a plot with data labels on specific points, with 10^-7 displayed in the data label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA D_DailyDataForPub;
    SET D_DailyDataForPub;
    IF Date EQ '17OCT2020'D THEN DO;
/* I tried using superscript, but it did not work: */
/*&lt;BR /&gt;        MaxLabelGE=CATX(" ","17 Oct:",PUT(_g_11dfx5ynpb_GTExt_2020_10_20,8.1),CATT("x 10","(*ESC*){super -7}"));
        MaxLabelCR=CATX(" ","17 Oct:",PUT(_g_NZCR__GTExt_2020_10_20     ,8.1),CATT("x 10","(*ESC*){super -7}"));    
        MaxLabelER=CATX(" ","17 Oct:",PUT(E_R_GTExt_2020_10_20          ,8.1),CATT("x 10","(*ESC*){super -7}"));         
*/
/* Then I tried unicode */
        MaxLabelGE=CATX(" ","17 Oct:",PUT(_g_11dfx5ynpb_GTExt_2020_10_20,8.1),CATT("x 10","(*ESC*){unicode '207B'x}","(*ESC*){unicode '2077'x}"));
        MaxLabelCR=CATX(" ","17 Oct:",PUT(_g_NZCR__GTExt_2020_10_20     ,8.1),CATT("x 10","(*ESC*){unicode '207B'x}","(*ESC*){unicode '2077'x}"));    
        MaxLabelER=CATX(" ","17 Oct:",PUT(E_R_GTExt_2020_10_20          ,8.1),CATT("x 10","(*ESC*){unicode '207B'x}","(*ESC*){unicode '2077'x}"));         
    END;
    ELSE DO;
        MaxLabelGE=" ";
        MaxLabelCR=" ";
        MaxLabelER=" ";
    END;
RUN;
PROC FREQ
    DATA=D_DailyDataForPub;
    TABLE MaxLabel:;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I use proc freq, I get the desired result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Freq: One-Way Frequencies" frame="box" rules="groups" cellspacing="1" cellpadding="7"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="l b header" scope="col"&gt;MaxLabelGE&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Percent&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Frequency&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Cumulative&lt;BR /&gt;Percent&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l rowheader" scope="row"&gt;17 Oct: 380861.3 x 10⁻⁷&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;100.00&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;100.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;TFOOT&gt;
&lt;TR&gt;
&lt;TH class="c b footer" colspan="5"&gt;Frequency Missing = 91&lt;/TH&gt;
&lt;/TR&gt;
&lt;/TFOOT&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the plot does not display properly:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT
    NOBORDER
    DATA=D_DailyDataForPub;
    YAXIS LABEL="Log of Raw search probability (x 10(*ESC*){unicode '2077'x})" VALUES=(0 TO 13 BY 1) RANGES=(0-1 5-13);
    XAXIS TYPE=TIME FITPOLICY=SPLIT INTERVAL=Day ;*VALUESFORMAT=DATETIME10.;
    SERIES X=Date Y=LogElection   /DATALABEL=MaxLabelGE;
    SERIES X=Date Y=LogCannabis   /DATALABEL=MaxLabelCR;      
    SERIES X=Date Y=LogEuthanasia /DATALABEL=MaxLabelER;      
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Election and Referendums-log.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50859i8DB033486983D6A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Election and Referendums-log.png" alt="Election and Referendums-log.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that the superscript in the y axis label does work.&lt;/P&gt;
&lt;P&gt;I have looked at:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2011/11/14/the-power-of-unicode/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2011/11/14/the-power-of-unicode/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/24/934.html" target="_blank"&gt;https://support.sas.com/kb/24/934.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/39/267.html" target="_blank"&gt;https://support.sas.com/kb/39/267.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But I can't get this to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 23:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/superscript-in-data-label/m-p/693048#M20585</guid>
      <dc:creator>JacquesR</dc:creator>
      <dc:date>2020-10-20T23:44:46Z</dc:date>
    </item>
  </channel>
</rss>

