Mathematical squiggles in SAS

John D. Cook shared a picture of "pretty squiggles" on his blog, as well as a prose description of the mathematics behind it.

I'm more of a programmer than a mathematician, but I've attempted to transcribe his description into a SAS program. I used DATA step to generate the point values, and then PROC SGPLOT and the SERIES statement to plot them.

/* Create a data set with the 3 sets of data points */
data squiggle;
do time=-100 to 100 by 0.01;
blue = sin(time);
/* hope I've got the golden ratio (phi) correct */
green = 0.7 * sin( ((1+sqrt(5))/2) * time );
red = blue+green;
output;
end;
run;

ods graphics / width=2000 height=200;

/* Plot the data using a series of SERIES plots */
proc sgplot data=squiggle noautolegend;
series x=time y=blue
/ lineattrs=(color=blue pattern=solid);
series x=time y=green
/ lineattrs=(color=green pattern=solid);
series x=time y=red
/ lineattrs=(color=red pattern=solid);
xaxis display=none ;
yaxis display=none ;
run;

As a variation, I included a "filled" version of the plot using the BAND statement instead of SERIES.

/* a variation that uses a BAND plot instead */
proc sgplot data=squiggle noautolegend;
band x=time lower=0 upper=blue
/ transparency=0.6 fillattrs=(color=blue);
band x=time lower=0 upper=green
/ transparency=0.6 fillattrs=(color=green);
band x=time lower=0 upper=red
/ transparency=0.6 fillattrs=(color=red);
xaxis display=none;
yaxis display=none grid;
run;

I don't understand all of the topics that John covers in his blog, but I'm a regular reader anyway. As with Rick Wicklin's blog, I tend to feel smarter while I read it, even though I don't have the ability to explain what I've read to anyone else.