plot3d Color Functions
other plot3d options; see plot3d/options
color specification; procedure or expression, or a list of three procedures or expressions
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.
In the following example, the surface and the color function are specified by procedures.
f ≔ x,y→4⁢sin⁡x2+sin⁡y4+3⁢sin⁡x2
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.
Download Help Document