11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

282 • Chapter 6: <strong>Programming</strong> with Maple Graphics0.2 0.4 0.6 0.8 1The AXESTICKS(DEFAULT, 0) specification eliminates the axes labelingalong the vertical axis but leaves the default labeling along the horizontalaxis.You can create a colormapHue procedure which creates the color scalefor any color function based on HUE coloring.> colormapHue := proc(F, n)> local i, points;> points := seq( evalf( [ [i/n, 0], [i/n, 1],> [(i+1)/n, 1], [(i+1)/n, 0] ]> ), i=0..n-1 ):> PLOT( POLYGONS( points,> COLOUR(HUE, seq( evalf(F(i/n)), i=0.. n-1) )),> AXESTICKS(DEFAULT, 0), STYLE(PATCHNOGRID) );> end proc:The basis of this color scale is y(x) = sin(πx)/3 for 0 ≤ x ≤ 40.> colormapHue( x -> sin(Pi*x)/3, 40);0.2 0.4 0.6 0.8 1To create the grayscale coloring, use an arbitrary procedure, F , sincegray levels have equal parts of red, green, and blue.> colormapGraylevel := proc(F, n)> local i, flatten, points, grays;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!