Graphics Programming

Data visualization using SAS programming, including ODS Graphics and SAS/GRAPH. Charts, plots, maps, and more!
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;


undefined
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; /* --- */


undefined
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 13 replies
  • 3372 views
  • 3 likes
  • 5 in conversation