Surface filling types
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
|Objects||FillColorType Default Values|
FillColorType selects the type of surface
fill color used.
With the exception of
the coloring schemes depend on the height, i.e., the z value
of points on the surface, in relation to the height of the whole coordinate
system. (Everything on this page relating to surfaces holds for objects
plot::Density, too, with the values
plotted replacing height information.)
The default just described.
The surface is filled with
blend is used.
The surface is filled with a blend from
a dimmed version of
This setting is technically similar to
but the effect is vastly different, since interpolation takes place
in HSV color space. This creates a rainbow effect, similar to a physical
rainbow for suitable choices of colors.
ignored; the color scheme is derived from
FillColorFunction for details (which
depend on the object type). If no color function is given, the object
will be rendered with
In this context, “a blend from A to B” means that color A is used at the top of the coordinate system (the part with the lowest z coordinate), color B is used at the bottom and in between each or the red, green, blues, and alpha channel are interpolated linearly.
By default, function plots use
FillColorType = Dichromatic with
a color range from blue to red (as in a temperature scale):
FillColorType, we color the graph completely
plotfunc3d(sin(x)*sin(y), FillColorType = Flat)
Note, however, that the coloring is a visual aid, e.g., when looking from above:
plotfunc3d(sin(x)*sin(y), CameraDirection = [0, 0, 1])
plotfunc3d(sin(x)*sin(y), FillColorType = Flat, CameraDirection = [0, 0, 1])
In MuPAD®, rainbow coloring does react to
The following plot uses different color settings to show this effect:
plot(plot::Function3d(sin(y), x = 0..10, y = -PI..PI, FillColor = RGB::BlueLight, FillColor2 = RGB::Blue), plot::Function3d(sin(y), x = 0..10, y = PI..3*PI, FillColor = RGB::Green, FillColor2 = RGB::Red), FillColorType = Rainbow, XLinesVisible = FALSE, YLinesVisible = FALSE)
What is happening here technically is that MuPAD performs a linear interpolation in HSV color space, i.e., the longest path round the following color circle is followed, with saturation and value (roughly speaking, whiteness and blackness) interpolated linearly:
The opacity of colors is treated the same way in both the
FillColorType, by linear interpolation:
plot((f:=plot::Function3d(sin(y), x = 0..10, y = -PI..PI, FillColorType = Rainbow, FillColor2 = RGB::VioletDark.[0.2], XLinesVisible = FALSE, YLinesVisible = FALSE)))
FillColorFunction for an object automatically
colorfunc := (x, y) -> [abs(x)/PI, 0, abs(y)/PI]: f := plot::Function3d(sin(x)*cos(y), x = -PI..PI, y = -PI..PI, FillColorFunction = colorfunc): f::FillColorType
delete colorfunc, f: