Here's a quick SAS ODS Graphics take on Northstory.ca's clever Modern Christmas Cards DIY project. Happy Holidays!
* Fun w/SAS ODS Graphics: A '2605'x, a '2605'x / Dancing in the night;
data stars; /* Create points for scatter plots */
input x y@@; /* Read x-y pairs of points for "stars" */
if x=3 & y=4 then color=2; else color=1; /* Assign different color to one star */
y=y*.85; /* Tighten up y-axis a smidgen */
xStand=2.5; /* Add points for "tree stand" */
yStand=1*.85;
datalines;
2.5 5 2 4 3 4 1.5 3 2.5 3 3.5 3 1 2 2 2 3 2 4 2
;
ods graphics on / reset=index imagefmt=gif antialias height=5in width=5in;
proc sgplot data=stars noautolegend noborder pad=0 aspect=1;
styleattrs datacontrastcolors=(CX085411 hotpink);
symbolchar name=uniStar char='2605'x; /* Unicode for 5-pointed star */
symbolchar name=uniRectangle char='25AE'x; /* Unicode for vertical rectangle */
xaxis display=none offsetmin=0 offsetmax=0 values=(0 5);
yaxis display=none offsetmin=0 offsetmax=0 values=(.005 5);
scatter x=x y=y / /* Stars */
markerattrs=(symbol=unistar size=116pt) group=color;
scatter x=xStand y=yStand / /* Tree stand */
markerattrs=(symbol=unirectangle color=CX085411 size=116pt);
Perhaps worth pointing out that you need to run this under 9.4.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.