Overview - Maple Help

Plot Color Option

 Calling Sequence plotcommand(plotargs, color=c) plotcommand(plotargs, colour=c)

Parameters

 plotcommand - any plotting command such as plot or plot3d that accepts the color option plotargs - arguments to the plot command c - string representing a color name, a color data structure, a procedure, or an expression

Description

 • The color of a plot can be specified using the option color=c, where c is a string or a color data structure. Some 3-D plotting commands can also accept a color option value in the form of a procedure or expression. For a list of color names, see the plot/colornames help page.
 • The strings that can be given directly to a plotting command are those from the "HTML" color palette. To see a list of all colors in this palette, issue the command ColorTools:-GetPalette("HTML"). See the ColorTools:-GetPalette help page for more information.
 • Colors from other palettes understood by Maple can also be used by adding the palette name as a prefix in the string passed to the plotting command. For example, to generate a curve with the "Violet" color from the "Spring" palette, use the option color="Spring Violet". Use the option color="Spring n", where n is a positive integer, to get the n-th color from the "Spring" palette. Note that built-in palettes are automatically expanded as needed, so n can be larger than the number of entries shown by the ColorTools:-GetPalette command. The ColorTools:-PaletteNames command gives a list of all available palettes.
 • You can specify colors by their RGB values using a color data structure, which is constructed with the ColorTools:-Color command. An example is: color=ColorTools:-Color([0.5, 0.2, 0.1]). Other color spaces, such as "HSV", are also available and are described on the ColorTools:-ColorSpaces help page. Multiple colors, given as Arrays of RGB, HSV or HUE values, may be provided through a color data structure as described on the plot/structure help page. You must ensure that the Array dimensions are appropriate for the plot object being displayed.
 • A default set of colors from the "Niagara" palette is used by certain plotting commands, including the 2-D plot command. You can change the default assignment of colors with the plots:-setcolors command.
 • Some 3-D plotting commands, including plot3d, also allow you to specify a procedure or an expression involving the plot variables. This feature is useful for purposes such as visualizing four-dimensional objects using color as the fourth dimension.  For more information, see the plot3d/colorfunc help page. You can also apply color schemes to surfaces with the colorscheme option, as described on the plot/colorscheme help page.

Examples

 > $\mathrm{plot}\left(\mathrm{sin},\mathrm{color}="SteelBlue"\right)$
 > $\mathrm{plot}\left(\mathrm{cos},\mathrm{color}="Niagara DarkOrchid"\right)$
 > $\mathrm{plot3d}\left(\mathrm{sin}\left(x\right)\mathrm{cos}\left(y\right),x=-\mathrm{\pi }..\mathrm{\pi },y=-\mathrm{\pi }..\mathrm{\pi },\mathrm{color}="Nautical GrayViolet"\right)$

Plot the tan function in sky blue.

 > $\mathrm{myskyblue}≔\mathrm{ColorTools}:-\mathrm{Color}\left(\left[0.196,0.6,0.8\right]\right):$
 > $\mathrm{plot}\left(\mathrm{tan}\left(x\right),x=-1..1,\mathrm{color}=\mathrm{myskyblue},\mathrm{thickness}=3\right)$

Plot a randomly colored checkerboard.

 > $p≔\mathrm{seq}\left(\mathrm{seq}\left(\mathrm{plots}\left[\mathrm{polygonplot}\right]\left(\left[\left[i,j\right],\left[i+1,j\right],\left[i+1,j+1\right],\left[i,j+1\right]\right],\mathrm{color}=\mathrm{ColorTools}:-\mathrm{Color}\left(\left[\frac{\mathrm{rand}\left(\right)}{{10}^{12}},\frac{\mathrm{rand}\left(\right)}{{10}^{12}},\frac{\mathrm{rand}\left(\right)}{{10}^{12}}\right]\right)\right),i=1..10\right),j=1..10\right):$
 > $\mathrm{plots}\left[\mathrm{display}\right]\left(\left[p\right]\right)$

Create a randomly colored polygon animation sequence.

 > $p≔\mathrm{seq}\left(\mathrm{plots}\left[\mathrm{polygonplot}\right]\left(\left[\left[0,0\right],\left[1,0\right],\left[1,1\right],\left[0,1\right]\right],\mathrm{axes}=\mathrm{none},\mathrm{color}=\mathrm{ColorTools}:-\mathrm{Color}\left(\left[\frac{\mathrm{rand}\left(\right)}{{10}^{12}},\frac{\mathrm{rand}\left(\right)}{{10}^{12}},\frac{\mathrm{rand}\left(\right)}{{10}^{12}}\right]\right)\right),i=1..20\right):$
 > $\mathrm{plots}\left[\mathrm{display}\right]\left(\left[p\right],\mathrm{insequence}=\mathrm{true},\mathrm{axes}=\mathrm{none}\right)$

Create another polygon animation sequence using an HSV color specification.

 > $p≔\mathrm{seq}\left(\mathrm{plots}\left[\mathrm{polygonplot}\right]\left(\left[\left[0,0\right],\left[1,0\right],\left[1,1\right],\left[0,1\right]\right],\mathrm{axes}=\mathrm{none},\mathrm{color}=\mathrm{ColorTools}:-\mathrm{Color}\left("HSV",\left[0.5,0.8,\frac{i}{20.0}\right]\right)\right),i=1..20\right):$
 > $\mathrm{plots}\left[\mathrm{display}\right]\left(\left[p\right],\mathrm{insequence}=\mathrm{true},\mathrm{axes}=\mathrm{none}\right)$

Compatibility

 • The Plot Color Option command was updated in Maple 18.
 • The color option was updated in Maple 18.