Data visualization with SAS programming

How to include symbols into a dataset

Accepted Solution Solved
Reply
Contributor
Posts: 28
Accepted Solution

How to include symbols into a dataset


Dear All,

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

Thanks in advance.

John


Accepted Solutions
Solution
‎06-19-2012 07:19 PM
SAS Super FREQ
Posts: 1,134

Re: How to include symbols into a dataset

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

View solution in original post


All Replies
SAS Super FREQ
Posts: 1,134

Re: How to include symbols into a dataset

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

Contributor
Posts: 28

Re: How to include symbols into a dataset

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

Super User
Posts: 11,101

Re: How to include symbols into a dataset

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

Contributor
Posts: 28

Re: How to include symbols into a dataset

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

Valued Guide
Posts: 765

Re: How to include symbols into a dataset

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
Contributor
Posts: 28

Re: How to include symbols into a dataset

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

Valued Guide
Posts: 765

Re: How to include symbols into a dataset

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
Contributor
Posts: 28

Re: How to include symbols into a dataset

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.

SAS Employee
Posts: 977

Re: How to include symbols into a dataset

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.

Contributor
Posts: 28

Re: How to include symbols into a dataset

thanks!

Contributor
Posts: 28

Re: How to include symbols into a dataset

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


Solution
‎06-19-2012 07:19 PM
SAS Super FREQ
Posts: 1,134

Re: How to include symbols into a dataset

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

Contributor
Posts: 28

Re: How to include symbols into a dataset

Thanks Sanjay! this is the simplest way. 

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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