Overview - Maple Help

Home : Support : Online Help : Graphics : 3-D : Options : color : plot3d/colorfunc

plot3d Color Functions

 Calling Sequence plot3d(plot3dops, color=c)

Parameters

 plot3dops - other plot3d options; see plot3d/options color=c - color specification; procedure or expression, or a list of three procedures or expressions

Description

 • Three-dimensional plot objects can be colored with the color option in three ways: using a color name, using specific RGB or hue values (via a color data structure), or using a color function (given as a procedure or expression). For instructions on how to specify a single color using pre-defined names or specific RGB or hue values, see plot/color. See also the plot/colorscheme help page for an alternative way to color a surface. This help page describes how to specify color of 3-D plots using color functions.
 • You can specify the coloring using an expression or a list of three expressions in terms of the plot variables. In case of the single expression, the resulting values over the plotting domain are mapped to the HUE coloring scheme. In case of the list of three expressions, the resulting tuples over the plotting domain are mapped to RGB values. To map to HSV values, include the option colortype=HSV as the fourth element of the list.
 • Similarly, you can specify the coloring using a procedure or a list of three procedures optionally followed by colortype=HSV.  The use of an expression or a procedure in the color specification should be consistent with the input that is provided for plotting.  For example, if the first argument to plot3d is a procedure, then a procedure (taking two input parameters and returning a HUE value), rather than an expression, should be used with the color option.
 • In general, specifying the color using procedures or expressions works only with surfaces defined explicitly by a procedure or expression.  For example, spacecurves generated by the plots[spacecurve] command and most surfaces generated by the plottools package commands cannot be colored in this way.  Instead, you can color those surfaces as described in plot/color.
 • The color option allows coloring with a function of the first two coordinates only. Coloring with a function of all three coordinates can be done using the colorscheme option. See plot/colorscheme/coordinates for more information.

Examples

In the following example, the surface and the color function are specified by procedures.

 > $f≔\left(x,y\right)↦7\cdot \mathrm{sin}\left(\frac{x}{2}\right)+4\cdot \mathrm{sin}\left(\frac{y}{4}\right)$
 ${f}{≔}\left({x}{,}{y}\right){↦}{7}{\cdot }{\mathrm{sin}}{}\left(\frac{{x}}{{2}}\right){+}{4}{\cdot }{\mathrm{sin}}{}\left(\frac{{y}}{{4}}\right)$ (1)
 > plot3d(f, 0..20, 0..70, color=proc(x,y) x*y end proc);

In this example, the the surface and the color function are specified by expressions.

 > $\mathrm{plot3d}\left(\mathrm{sin}\left(x\right),x=0..8,y=0..8,\mathrm{style}=\mathrm{surface},\mathrm{scaling}=\mathrm{constrained},\mathrm{color}=\left[\mathrm{sin}\left(xy\right),\mathrm{cos}\left(xy\right),0.8,\mathrm{colortype}=\mathrm{HSV}\right]\right)$
 > $\mathrm{plot3d}\left(\mathrm{sin}\left(x\right),x=0..8,y=0..8,\mathrm{style}=\mathrm{surface},\mathrm{scaling}=\mathrm{constrained},\mathrm{color}=\left[\frac{x}{16},\mathrm{sin}\left(xy\right),\mathrm{cos}\left(xy\right)\right]\right)$