Dear All,
How to get symbols into a dataset? e.g. include circle, triangle, square etc. in a dataset column.
Thanks in advance.
John
Why doesn't the INSET work for you? Just add another entry with "o" = "Value" to my previous code.
Can you elaborate a bit more on what is it you want to see in the graph?
I am thinking if symbol is in the dataset, it can be customized to show in the legend.
It may be time to describe your final desired outcome. There may be several ways to accomplish what you want.
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
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;
Sorry, want circle for individual value, '---' for mean value, '- - -' for median value
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; /* --- */
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.
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.
thanks!
can we include these symbols into a dataset? How? thanks!
Why doesn't the INSET work for you? Just add another entry with "o" = "Value" to my previous code.
Thanks Sanjay! this is the simplest way.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.