BookmarkSubscribeRSS Feed
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

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

 

1 REPLY 1
lethcons
Obsidian | Level 7

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

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1394 views
  • 5 likes
  • 2 in conversation