Data visualization with SAS programming

Fun With SAS ODS Graphics: A '2605'x, a '2605'x / Dancing in the night

Reply
Highlighted
Frequent Contributor
Frequent Contributor
Posts: 89

Fun With SAS ODS Graphics: A '2605'x, a '2605'x / Dancing in the night

AstarAstar.gif

 

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);

 

Occasional Contributor
Posts: 18

Re: Fun With SAS ODS Graphics: A '2605'x, a '2605'x / Dancing in the night

Perhaps worth pointing out that you need to run this under 9.4.

Ask a Question
Discussion stats
  • 1 reply
  • 413 views
  • 5 likes
  • 2 in conversation