- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why doesn't the INSET work for you? Just add another entry with "o" = "Value" to my previous code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you elaborate a bit more on what is it you want to see in the graph?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am thinking if symbol is in the dataset, it can be customized to show in the legend.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It may be time to describe your final desired outcome. There may be several ways to accomplish what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, want circle for individual value, '---' for mean value, '- - -' for median value
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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; /* --- */
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
can we include these symbols into a dataset? How? thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why doesn't the INSET work for you? Just add another entry with "o" = "Value" to my previous code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sanjay! this is the simplest way.