Data visualization with SAS programming

Memorial Day

Reply
Highlighted
Frequent Contributor
Frequent Contributor
Posts: 76

Memorial Day

MemorialDay2017.png

 

SAS CODE

data;                                    /* Memorial Day image */
if _n_=1 then                            /* Generate marker points for grass */
do x1=-200 to 500 by 5;
  do y1=-200 to 500 by 5;
    rnum=ranuni(1);                      /* Random # for color assignment */
    output;
  end;
end;
x1=.; y1=.;
input x y @@;                            /* Polygon points for cross rectangles */
polygon=ceil(_N_/4);
output;
cards;
118 400 182 400 182 -35 118 -35
0   285 300 285 300 220 0   220
;    
ods graphics on / height=5in width=5in;  /* Generate image */
proc sgplot aspect=1 noautolegend noborder pad=0 nowall ;
xaxis display=none offsetmin=0 offsetmax=0;
yaxis display=none offsetmin=0 offsetmax=0;
scatter x=x1 y=y1 / colormodel=(lightgreen green darkgreen) colorresponse=rnum markerattrs=(symbol=circlefilled);
polygon x=x y=y id=polygon / fill fillattrs=(color=white) outline lineattrs=(color=black thickness=3pt);
polygon x=x y=y id=polygon / fill fillattrs=(color=white) nooutline;
inset "MEMORIAL DAY 2017" / position=bottom textattrs=(color=white weight=bold size=28pt);
Ask a Question
Discussion stats
  • 0 replies
  • 573 views
  • 3 likes
  • 1 in conversation