BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
John70
Calcite | Level 5


Dear All,

How to get symbols into a dataset?  e.g. include circle, triangle, square etc. in a dataset column.

Thanks in advance.

John

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

Why doesn't the INSET work for you?  Just add another entry with "o" = "Value" to my previous code.

View solution in original post

13 REPLIES 13
Jay54
Meteorite | Level 14

Can you elaborate a bit more on what is it you want to see in the graph? 

John70
Calcite | Level 5

I am thinking if symbol is in the dataset, it can be customized to show in the legend.

ballardw
Super User

It may be time to describe your final desired outcome. There may be several ways to accomplish what you want.

John70
Calcite | Level 5

Hi Ballardw,

I want to show symbols in legend, e.g. circle for individual value, triangle for mean value, and square for median.  Do you have any suggestion to include symbols in dataset?Thanks

John

MikeZdeb
Rhodochrosite | Level 12

hi ... not SGPLOT, but GPLOT ... produced the attached (easy to set up symbols and place control the legend) ...

* your data;

data try;

input trt numb value mean median run @@;

cards;

1 101 26.5 33.9 27.8 7 1 102 29 33.9 27.8 7

1 103 49.1 33.9 27.8 7 1 104 26 33.9 27.8 7

1 105 52.8 33.9 27.8 7 1 106 19.9 33.9 27.8 7

2 201 25.8 30.4 28.3 8 2 202 16.7 30.4 28.3 8

2 203 38.1 30.4 28.3 8 2 204 30.7 30.4 28.3 8

2 205 51.3 30.4 28.3 8 2 206 19.8 30.4 28.3 8

3 301 26.5 33.9 27.8 9 3 302 29 33.9 27.8 9

3 303 49.1 33.9 27.8 9 3 304 26 33.9 27.8 9

3 305 52.8 33.9 27.8 9 3 306 19.9 33.9 27.8 9

;

goptions reset=all ftext='calibri' htext=3 gunit=pct;

legend1 position=(top inside right) across=1 label=none

shape=symbol(1e-6,3) value=(j=r '  VALUE' '  MEDIAN' '  MEAN' );

axis1 order=1 to 3 by 1 minor=none offset=(20,20) label=('TREATMENT');

axis2 label=(a=90 'SOMETHING');


symbol1 f='wingdings 2' v='99'x c=blue h=3; /* open circle */

symbol2 f='wingdings 2' v='a2'x c=red h=3; /* solid square */

symbol3 f='wingdings 3' v='70'x c=red h=3; /* solid triangle */

title1 h=4 'PLOT OF "SOMETHING" VERSUS TREATMENT' ls=2;

title2 a=90 ls=2;

title3 a=-90 ls=2;

footnote1 ls=1;

proc gplot data=try;

plot value*trt=1 median*trt=2 mean*trt=3 /

overlay noframe haxis=axis1 vaxis=axis2 legend=legend1;

run;

quit;


plot.png
John70
Calcite | Level 5

Sorry, want circle for individual value, '---' for mean value, '- - -' for median value

MikeZdeb
Rhodochrosite | Level 12

hi ... change LEGEND and two SYMBOL statements ...

legend1 position=(top inside right) across=1 label=none

shape=symbol(1e-6,3.5) value=(j=r '  VALUE' '  MEDIAN' '  MEAN' );

symbol1 f='wingdings 2' v='99'x c=blue h=3; /* open circle */

symbol2 f='calibri/bo' v='- - -' c=red h=4; /* - - - */

symbol3 f='calibri/bo' v='---' c=red h=4; /* --- */


plot2.png
John70
Calcite | Level 5

Hi Mike,

Thanks!  I leart a lot.  Do we have a list of wingdings for symbols in SAS? e.g. '99' x for white circle, '98' x for black circle,   ??? for triagle.

GraphGuy
Meteorite | Level 14

If you're using Windows, you can bring up the Windows "Character Map", select the "Wingdings" font, and see all the characters.  Click on the character to see the numeric code (such as 99 and 98) for each of them.

John70
Calcite | Level 5

thanks!

John70
Calcite | Level 5

can we include these symbols into a dataset? How?  thanks!


Jay54
Meteorite | Level 14

Why doesn't the INSET work for you?  Just add another entry with "o" = "Value" to my previous code.

John70
Calcite | Level 5

Thanks Sanjay! this is the simplest way. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 13 replies
  • 1817 views
  • 3 likes
  • 5 in conversation