Data visualization with SAS programming

Quick Question on using annotate to create a custom symbol

Reply
Occasional Contributor
Posts: 10

Quick Question on using annotate to create a custom symbol

I can change the function to 'point' and get a tiny point in the attached code (text file), but I'm missing some critical detail to get an actual symbol of any size or type out of this.

My original intent was to set up something so that a particular and unique point from a data set gets a large, special, and unique symbol so that receipients of the graph can easy see where one particular point lies in relation to all the others.

Grateful for any suggestions.

Occasional Contributor
Posts: 10

Quick Question on using annotate to create a custom symbol

data wc; input grp $ 5. height weight; datalines; east 55 125 east 60 175 west 62 175 south 55 135 north 62 195 west 50 115 ; run; goptions reset=all gunit=pct ftext='calibri' htext=2; symbol v=dot h=2; axis1 label=(a=0 "Weight") order=100 to 200 by 10; axis2 label=(angle=90 "Height") order=40 to 100 by 10; legend1; legend2; data singlepoint (keep= xsys ysys hsys function style color size x y); set wc ; xsys = '2'; ysys = '2'; hsys = '3'; function ='symbol'; style = 'marker'; color ='black'; size=10; x =100; y =50; when = 'A'; run; proc gplot data=wc anno=singlepoint; plot height*weight =grp / haxis=axis1 vaxis=axis2 legend=legend1 anno=singlepoint ; run; quit;

SAS Employee
Posts: 967

Quick Question on using annotate to create a custom symbol

One way to annotate a 'dot' and have control over the size is to use the 'pie' function, and control the size (radius).

For example...

function='pie';

rotate=360;

style='psolid';

color='blue';

size=5;

Alternately, you can use the annotate 'label' function, and specify any font you want (via the style variable), and then use any character of that font.

Grand Advisor
Posts: 10,223

Quick Question on using annotate to create a custom symbol

Your options might involve placing text from the MARKER font or use PROC GFONT to create a graphic font from scratch to show what you want .

The %LABEL annotate macro would be the way to use either of these.

Occasional Contributor
Posts: 10

Quick Question on using annotate to create a custom symbol

Thanks to you both for your replies.  The pie function did not work, but the label function did, thanks!  I'm not (yet) into macros, but I'll keep that one in mind

I have noticed that in my x-setting statement, the x is in blue, while the y in the y-setting statement is in black.  Is this normal - why would SAS treat x as a key word?

Grand Advisor
Posts: 10,223

Quick Question on using annotate to create a custom symbol

X is a key word. It is a command used to run operating system commands.

Occasional Contributor
Posts: 10

Quick Question on using annotate to create a custom symbol

Thank you.  SAS is a great big world...

Ask a Question
Discussion stats
  • 6 replies
  • 262 views
  • 0 likes
  • 3 in conversation