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.

6.9 <strong>Programming</strong> with Color • 2811Blue=00.80.60.40.200.2 0.4 0.6 0.8 1Using AnimationYou can use animation to vary the blue component of the previous table.Example The following colormaps procedure uses animation to generatean m × n × f color table.> colormaps := proc(m, n, f)> local t;> PLOT( ANIMATE( seq( [ colormap(m, n, t/(f-1)) ],> t=0..f-1 ) ),> AXESLABELS("Red", "Green") );> end proc:The following gives you a 10 × 10 × 10 color table.> colormaps(10, 10, 10);You can create a color scale for HUE coloring as follows.> points := evalf( seq( [ [i/50, 0], [i/50, 1],> [(i+1)/50, 1], [(i+1)/50, 0] ],> i=0..49)):> PLOT( POLYGONS(points, COLOUR(HUE, seq(i/50, i=0..49)) ),> AXESTICKS(DEFAULT, 0), STYLE(PATCHNOGRID) );

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

Saved successfully!

Ooh no, something went wrong!