BookmarkSubscribeRSS Feed
Celine_France
Calcite | Level 5
Hi,

I want to write for example µ in axis labels but it doesn't work.

I keep the label in a macro variable and if I do the instruction put in order to see it in the log, the µ is written but on the graph, there is only °

Here is my code if it can help you :
goptions reset=all ftext=sasmonospace htext=1 ctext=black devmap=winansi keymap=winansi;
axis1 order=&min to &max label=("&x_lab ");
axis2 label=(angle=90 "&y_lab ") order=&min to &max;

symbol1 interpol=join value=none color=blue line=20;
symbol2 interpol=join value=none color=red line=1;
symbol3 interpol=none value='Circle' color=black;

legend1 label=none
mode=reserve
position=(bottom center outside)
offset=(0.5,)
across=3
shape=line(4)
value=('Perfect Concordance Line' 'Observed Concordance Line' ' ');

%macro graphe(yf,xf,minf,maxf);
%if &minf=0 or &maxf=0 %then %do;
proc gplot data=graphe_finale;
plot &yf*&xf Ybissector*i Yobserved*i/ overlay haxis=axis1 vaxis=axis2 legend=legend1 vminor=0 hminor=0 annotate=annoter ;
run;
quit;
%end;
%else %do;
proc gplot data=graphe_finale;
plot Ybissector*i Yobserved*i &yf*&xf/ overlay haxis=axis1 vaxis=axis2 legend=legend1 href=0 vref=0 vminor=0 hminor=0 annotate=annoter ;
run;
quit;
%end;
%mend graphe;
%graphe(&Y,&X,&min,&max)

By advance, thanks a lot,

Céline
6 REPLIES 6
DanH_sas
SAS Super FREQ
Hey Celine,

Can you give an example of the string assigned to &x_lab or &y_lab?

Thanks!
Dan
Andre
Obsidian | Level 7
Céline
In sas graph a greek letter is possible
see
http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0806A&L=sas-l&P=R22438&D=1&H=0&O=D&T=1

What i have never tested is their use
inside the axis statement due to another general ftext choice
I never use sasmonospace into sas graphs!

Another question is related to your graph : alone or inside an ods destination?

Andre
ChrisNZ
Tourmaline | Level 20
All valid comments above:
- what is the value of x_lab?
- do you use ODS?
- you must use another font.

You can assess fonts using:


goption ftext=greek;
*goption ftext='arial';
*goption ftext='verdana/bo';

proc gslide;
note height=2 "%sysfunc(getoption(ftext))";
%macro t;
%do i=32 %to 255 %by 32;
note height=2 %do j=&i %to %eval(&i+31); "%sysfunc(byte(&j))" %end; ;
%end;
%mend;%t
run;
quit;
Andre
Obsidian | Level 7
Celine
(now from work)

See it is working

ods listing close;
ods rtf file="d:\temp\greekfigure.rtf" style=minimal;

goptions device=png rotate=landscape gsflen=132 border htitle=1 htext=1;

proc gplot data=sashelp.class;
title2 font=cgreek height=1.5 'a b c d e f g h i j k l m n o p q r s t u v w x y z';
title3 font=cgreek height=1.5 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z';
axis1 order=10 to 20 label=(font=swiss "La " font=greek " m" font=swiss " des ados");
plot age * weight/haxis=axis1;
run; quit;
ods rtf close; ods listing;
DanH_sas
SAS Super FREQ
Here is yet another possibility. If you are running SAS 9.2, here's a trick you can use with the SG procedures. You can inline unicode character directly in the string. Taking Andre's example:

proc sgplot data=sashelp.class;
xaxis min=10 max=20 label="La (*ESC*){unicode mu} des ados";
scatter x=weight y=age;
run;

Notice that you do not have to change fonts in the middle of the label.
GraphGuy
Meteorite | Level 14

Here's one way to do it in SAS/Graph gplot axis:

 

goptions ftext='albany amt' htext=12pt;
axis1 label=("axis label text, with Mu symbol: %SYSFUNC(BYTE(181),$1.) ");
proc gplot data=sashelp.class;
plot height*weight / haxis=axis1;
run;

 

gplot5.png

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 3388 views
  • 2 likes
  • 5 in conversation