<?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 format for SGPLOT value labels in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/744982#M21598</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have defined a FORMAT that uses unicode superscripts:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc format;
		value agegroupfr 	1="1(*ESC*){super re} fois"
							2="2(*ESC*){super e} fois ou plus"
							3="18–24"
							4="25–34"
							5="35–44"
							6="45–54"
							7="55–64"
							8="65–74"
							9="75+"
							10="Toutes";
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;I want to use this format to be used to label values on the y-axes of a butterfly plot. Here is the portion of the code where I define the y-axes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	 	yaxis reverse
		 	display=(noticks)
		 	valueattrs=(color=gray33 size=10pt family="Arial Unicode MS")
		 	labelposition=top
		 	colorbands=odd colorbandsattrs=(color=grayf3)
		 	label="&amp;amp;aglab."
		 	valuesformat=&amp;amp;agfmt.;
		y2axis reverse
			type=discrete
		 	display=(noticks)
		 	valueattrs=(color=gray33 size=10pt family="Arial Unicode MS")
		 	labelposition=top
		 	label="&amp;amp;aglab."
		 	valuesformat=&amp;amp;agfmt.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;The result is not what I expected:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot31.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59932i649E8E558C8AA760/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot31.png" alt="SGPlot31.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have tried several solutions proposed in this forum, but with no effect. What am I doing wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jun 2021 16:01:08 GMT</pubDate>
    <dc:creator>gabonzo</dc:creator>
    <dc:date>2021-06-01T16:01:08Z</dc:date>
    <item>
      <title>Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/744982#M21598</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have defined a FORMAT that uses unicode superscripts:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc format;
		value agegroupfr 	1="1(*ESC*){super re} fois"
							2="2(*ESC*){super e} fois ou plus"
							3="18–24"
							4="25–34"
							5="35–44"
							6="45–54"
							7="55–64"
							8="65–74"
							9="75+"
							10="Toutes";
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;I want to use this format to be used to label values on the y-axes of a butterfly plot. Here is the portion of the code where I define the y-axes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	 	yaxis reverse
		 	display=(noticks)
		 	valueattrs=(color=gray33 size=10pt family="Arial Unicode MS")
		 	labelposition=top
		 	colorbands=odd colorbandsattrs=(color=grayf3)
		 	label="&amp;amp;aglab."
		 	valuesformat=&amp;amp;agfmt.;
		y2axis reverse
			type=discrete
		 	display=(noticks)
		 	valueattrs=(color=gray33 size=10pt family="Arial Unicode MS")
		 	labelposition=top
		 	label="&amp;amp;aglab."
		 	valuesformat=&amp;amp;agfmt.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;The result is not what I expected:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot31.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59932i649E8E558C8AA760/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot31.png" alt="SGPlot31.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have tried several solutions proposed in this forum, but with no effect. What am I doing wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 16:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/744982#M21598</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-06-01T16:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/744993#M21599</link>
      <description>&lt;P&gt;Have you tried this suggestion: &lt;A href="https://communities.sas.com/t5/Graphics-Programming/Superscript-in-axis-label-SGPLOT/td-p/529656" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/Graphics-Programming/Superscript-in-axis-label-SGPLOT/td-p/529656&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'm also assuming you have the ODS ESCAPECHAR set somewhere else since you haven't shown your full code. &lt;BR /&gt;&lt;BR /&gt;I'll move your post to the graphics forum, but it would probably help if you could include some data and the full code so someone can replicate your issue. Or make a simpler example using sashelp.class if necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI - it seems SUPER/SUB are not supported in AXIS statements but you can use the Unicode characters instead if it's available.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/744993#M21599</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-01T17:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745003#M21600</link>
      <description>&lt;P&gt;I have tried setting&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar="^";  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And redefining the format as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc format;
		value agegroupfr 	1="1^{super re} fois"
							2="2^{super e} fois ou plus"
							3="18–24"
							4="25–34"
							5="35–44"
							6="45–54"
							7="55–64"
							8="65–74"
							9="75+"
							10="Toutes";
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;No superscripts there either.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745003#M21600</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-06-01T17:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745006#M21601</link>
      <description>SUPER and SUB do not work in AXIS statements. You need to use the codes as indicated in the post I've linked to, your code is still using SUPER/SUB.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745006#M21601</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-01T17:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745012#M21604</link>
      <description>&lt;P&gt;Thank you for your help, but nope:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc format;
		value agegroupfr 	1="1^{unicode '1d49'x} fois"
							2="2(*ESC*){unicode '1d49'x} fois ou plus"
							3="18–24"
							4="25–34"
							5="35–44"
							6="45–54"
							7="55–64"
							8="65–74"
							9="75+"
							10="Toutes";
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot91.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59938i3EB0CBB99CC3364C/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot91.png" alt="SGPlot91.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 18:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745012#M21604</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-06-01T18:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745015#M21605</link>
      <description>&lt;P&gt;Simplified example so anybody can try:&lt;/P&gt;
&lt;P&gt;Creating the unicode format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	value unitest 	0="^{unicode '0024'x}"
				1="^{unicode '0040'x}";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating the dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	x=0;
	y=0;
	output;
	x=1;
	y=1;
	output;
	format y unitest.;
run;

proc print data=have;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks good so far:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.HAVE" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;x&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;y&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;0&lt;/TD&gt;
&lt;TD class="r data"&gt;$&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;@&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, let's try to plot it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar="^";  
proc sgplot data=have;
	scatter x=x y=y;
	yaxis display=(noticks) valueattrs=GraphTextUnicode;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;aaand....&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot95.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59939iAAD4F1087AB898A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot95.png" alt="SGPlot95.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;*sad_trombone.mp3*&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 18:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745015#M21605</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-06-01T18:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745023#M21606</link>
      <description>&lt;P&gt;I don't think it can be done normally, so I would suggest looking into annotation which allows all superscripts and Unicode.&amp;nbsp; Here is a link to SG annotation dataset information: &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n17wm229xfidj7n1nfx67jsb3yj5.htm" target="_self"&gt;link&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following example I make an annotation dataset and make the normal tick values white so they can't be seen (but still create the graph space for them).&amp;nbsp; I then use annotation to draw new y-axis tick values with the wanted superscripts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    value xx
        80='80(*ESC*){Sup "e"}'
        60='60(*ESC*){Sup "er"}';
run;

data yaxis;
   length function $ 8 label $ 25;
    do i = 60 to 140 by 20;
       function="text"; x1=-5; y1=i; x1space="datapercent";y1space="Datavalue";
      label=strip(put(i,xx.));size=10;textcolor='black';
      output;
    end;
      /* create observation to draw the title */
    do i = 60 to 140 by 20;
       function="text"; x1=105; y1=i; x1space="datapercent";y1space="Datavalue";
      label=strip(put(i,xx.));size=10;textcolor='black';
      output;
    end;
    drop i;
run;

ods graphics / reset;
proc sgplot data=sashelp.class sganno=yaxis;
    scatter x=height y=weight;
    scatter x=height y=weight / y2axis markerattrs=(size=0pt);
    yaxis valueattrs=(color=white) labelposition=top ;
    y2axis valueattrs=(color=white) display=(nolabel)  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 666px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59941i19BDCC9BD7195208/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 19:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745023#M21606</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2021-06-01T19:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Superscript in format for SGPLOT value labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745024#M21607</link>
      <description>Thank you!</description>
      <pubDate>Tue, 01 Jun 2021 19:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Superscript-in-format-for-SGPLOT-value-labels/m-p/745024#M21607</guid>
      <dc:creator>gabonzo</dc:creator>
      <dc:date>2021-06-01T19:24:21Z</dc:date>
    </item>
  </channel>
</rss>

