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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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