data eclipse; /* Generate points for sun/moon */ do frame=1 to 81; /* At 11 different times/locations */ sunX=.5; sunY=.5; sz=50; output; /* Sun plotted at constant position in frame */ sunX=.; sunY=.; if frame<=41 then /* Sun goes behind moon in first 6 frames */ moonX=.5+(41-frame)*(.775/40); else if frame <=46 then /* Sun emerges from behind moon in last 5 frames */ moonX=.5; else moonX=.5-(frame-46)*(.775/40); moonY=.5; sz=46; output; /* Make moon slightly smaller bubble than sun */ moonX=.; moonY=.; sz=1; output; /* "Dummy" points with size=1 make sun/moon bigger */ /*-_Background polygon--*/ Id=frame; x=0; y=-1; color=frame; output; Id=frame; x=1; y=-1; color=frame; output; Id=frame; x=1; y=1; color=frame; output; Id=frame; x=0; y=1; color=frame; output; call missing (id, x, y, color); end; data myrattrmap; retain id "myID"; length min $ 5 max $ 5; input min $ max $ colormodel1 $ colormodel2 $; datalines; 1 41 gray black 42 46 black black 47 81 black gray ; run; ods _all_ close; options papersize=('5 in', '3.8 in') printerpath=gif animation=start animduration=0.1 animloop=yes noanimoverlay; ods printer file='C:\Work\SASUser\SolarEcplise\Eclipse.gif'; /* "Time-lapse" is 1x11 panel of bubble plots */ ods graphics / width=4.8in height=3.6in; proc sgplot data=eclipse noautolegend noborder nowall rattrmap=myrattrmap; by frame; polygon id=id x=x y=y / colorresponse=id fill nooutline rattrid=myid; bubble x=sunX y=sunY size=sz / colormodel=(yelloworange) colorresponse=sunX dataskin=sheen bradiusmax=120; bubble x=moonX y=moonY size=sz / colormodel=(black) colorresponse=moonX dataskin=sheen bradiusmax=120; yaxis display=none values=(0 to 1) min=0 max=1 offsetmin=0 offsetmax=0; xaxis display=none values=(0 to 1) min=0 max=1 offsetmin=0 offsetmax=0; run; options printerpath=gif animation=stop; ods printer close;