Skip to Main Content Skip to Search
Product Documentation

FillColorTypesurface filling types

FillColorType selects the type of surface fill color used.

→ Examples

Attribute

Type

Value

See Also:

FillColor, FillColor2, Filled, FillPattern, LineColorType, Shading

Details:

Example 1

By default, function plots use FillColorType = Dichromatic with a color range from blue to red (as in a temperature scale):

plotfunc3d(sin(x)*sin(y))

MuPAD graphics

Using FillColorType, we color the graph completely in red:

plotfunc3d(sin(x)*sin(y), FillColorType = Flat)

MuPAD graphics

Note, however, that the coloring is a visual aid, e.g., when looking from above:

plotfunc3d(sin(x)*sin(y),
           CameraDirection = [0, 0, 1])

MuPAD graphics

plotfunc3d(sin(x)*sin(y), FillColorType = Flat,
           CameraDirection = [0, 0, 1])

MuPAD graphics

Example 2

In MuPAD®, rainbow coloring does react to FillColor and FillColor2. 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)

MuPAD graphics

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:

MuPAD graphics

The opacity of colors is treated the same way in both the Rainbow and Dichromatic settings of 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)))

MuPAD graphics

Example 3

Setting a FillColorFunction for an object automatically sets FillColorType to Functional:

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

Functional

plot(f)

MuPAD graphics

delete colorfunc, f:

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS