Hi all,
I want to use 'a^' as a mark in my plot2, but I don't know how to combine the character (a) with symbol(^). Need help
data sat;
infile datalines firstobs = 3 delimiter='.' truncover ;
input year 4. @6 L_quart 5. U_quart
;
datalines;
Year Lower Upper
Quart Quart
2015 1200 1360
2014 1170 1330
2013 1170 1330
2012 1140 1330
2011 1130 1320
2010 1110 1310
2009 1140 1310
2008 1120 1290
2007 1130 1300
2006 1150 1310
;
proc
print data = sat;
PROC SGPLOT DATA = sat;
symbolchar name=plot1 char='0056'x;
symbolchar name=plot2 char='0061'x/'02C4'x;
SCATTER X = year Y = L_quart / MARKERATTRS = (SYMBOL=plot1 size=12pt);
SCATTER X = year Y = U_quart / markerattrs=(symbol=plot2 size=12pt);
Would you like the ^ over the A? That may be the unicode 00C2, or 00E2 in lower case.
The syntax implies only a single character is allowed.
I would like to have both of them come together like this 'a^' not separate like this 'a' '^'.
Thank
If you are really wanting "a^" (two adjacent characters as one symbol), your best option is to retain a column in your datastep with that string, and use the MARKERCHAR option to reference it. Do something like the following:
data sat;
infile datalines firstobs = 3 delimiter='.' truncover ;
retain mysymbol "a^";
input year 4. @6 L_quart 5. U_quart
;
datalines;
Year Lower Upper
Quart Quart
2015 1200 1360
2014 1170 1330
2013 1170 1330
2012 1140 1330
2011 1130 1320
2010 1110 1310
2009 1140 1310
2008 1120 1290
2007 1130 1300
2006 1150 1310
;
proc
print data = sat;
PROC SGPLOT DATA = sat;
symbolchar name=plot1 char='0056'x;
SCATTER X = year Y = L_quart / MARKERATTRS = (SYMBOL=plot1 size=12pt);
SCATTER X = year Y = U_quart / markerchar=mysymbol markerattrs=(size=12pt);
Hope this helps!
Dan
@Koke, SYMBOLCHAR was added in 9.4M1 -- what version are you running? See this SAS note.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.