3-D Visualization - The MathWorks - #29

/ 212


catalogue search
P. 01
P. 02
P. 03
P. 04
P. 05
P. 06
P. 07
P. 08
P. 09
P. 10
P. 11
P. 12
P. 13
P. 14
P. 15
P. 16
P. 17
P. 18
P. 19
P. 20
P. 21
P. 22
P. 23
P. 24
P. 25
P. 26
P. 27
P. 28
P. 29
P. 30
P. 31
P. 32
P. 33
P. 34
P. 35
P. 36
P. 37
P. 38
P. 39
P. 40
P. 41
P. 42
P. 43
P. 44
P. 45
P. 46
P. 47
P. 48
P. 49
P. 50


See other catalogues for The MathWorks

Text version of the page
Coloring Mesh and Surface Plots
Types of Color Data
The type of color data you specify (i.e., single values or RGB triplets) determines how MATLAB interprets it. When you create a surface plot, you can
• Provide no explicit color data, in which case MATLAB generates colormap indices from the z-data.
• Specify an array of color data that is equal in size to the z-data and is used for indexed colors.
• Specify an m-by-n-by-3 array of color data that defines an RGB triplet for each element in the m-by-nz-data array and is used for truecolor.
Colormaps
Each MATLAB figure window has a colormap associated with it. A colormap is simply a three-column matrix whose length is equal to the number of colors it defines. Each row of the matrix defines a particular color by specifying three values in the range 0 to 1. These values define the RGB components (i.e., the intensities of the red, green, and blue video components).
The colormap function, with no arguments, returns the current figure's colormap.
For example, the MATLAB default colormap contains 64 colors and the 57th color is red.
cm = colormap; cm(57,:) ans =
10 0
RGB Color Components
This table lists some representative RGB color definitions.
Red
Green
Blue
Color
0
0
0
Black
1-17

pageCatalog pdf di En 2012-06-22-01