I am trying to create a plot with data labels on specific points, with 10^-7 displayed in the data label.
DATA D_DailyDataForPub;
SET D_DailyDataForPub;
IF Date EQ '17OCT2020'D THEN DO;
/* I tried using superscript, but it did not work: */
/*
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;
When I use proc freq, I get the desired result:
However, the plot does not display properly:
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;
Note that the superscript in the y axis label does work.
I have looked at:
https://blogs.sas.com/content/graphicallyspeaking/2011/11/14/the-power-of-unicode/
https://support.sas.com/kb/24/934.html
https://support.sas.com/kb/39/267.html
But I can't get this to work.
Any help would be appreciated.