plots - Maple Programming Help

Home : Support : Online Help : Graphics : Packages : plots : plots/setcolors

plots

 setcolors
 set colors for 2-D plots

 Calling Sequence setcolors(colorlist)

Parameters

 colorlist - (optional) a non-empty list of colors, one of the following strings: "default", "Default", "Nautical", "Niagara", "Spring", "Classic", or any ColorTools palette name.

Description

 • The setcolors command sets the colors for curves in 2-D plots.  When multiple curves are plotted, the plotting command cycles through a default list of colors. This command allows you to see the current list or alter it.
 • The colors in colorlist may be color names or structures as described in the plot/color help page.  The plot/colornames help page provides a list of all predefined HTML color names.
 • If colorlist is a non-empty list of colors, then the current list of colors is set to colorlist.  If colorlist is the string "default" or "Default", then the current list of colors is reset to default colors. If colorlist is the string "Classic", then the list of colors used in Maple 15 and earlier versions is used. In all cases, the previously saved list is returned.
 • You can also provide any palette name understood by the ColorTools package as colorlist.  The default used for 2-D plotting is the Niagara palette. The Nautical and Spring palettes are also recommended for plotting curves.
 • If you wish to use an alternative to the default palette every time you run Maple, it is recommended that you put the plots:-setcolors call in your Maple initialization file. (See Create Maple Initialization File for more information.)
 • If setcolors is called with no arguments, then the current list is returned unchanged.

Examples

 > $\mathrm{with}\left(\mathrm{plots}\right):$

View the current colors.

 > $\mathrm{setcolors}\left(\right)$
 $\left[{"#78000E"}{,}{"#000E78"}{,}{"#4A7800"}{,}{"#3E578A"}{,}{"#780072"}{,}{"#00786A"}{,}{"#604191"}{,}{"#004A78"}{,}{"#784C00"}{,}{"#91414A"}{,}{"#3E738A"}{,}{"#78003B"}{,}{"#00783F"}{,}{"#914186"}{,}{"#510078"}{,}{"#777800"}\right]$ (1)

Define a new list of colors.

 > $\mathrm{setcolors}\left(\left["BlueViolet","Coral"\right]\right)$
 $\left[{"#78000E"}{,}{"#000E78"}{,}{"#4A7800"}{,}{"#3E578A"}{,}{"#780072"}{,}{"#00786A"}{,}{"#604191"}{,}{"#004A78"}{,}{"#784C00"}{,}{"#91414A"}{,}{"#3E738A"}{,}{"#78003B"}{,}{"#00783F"}{,}{"#914186"}{,}{"#510078"}{,}{"#777800"}\right]$ (2)

Plot a set of curves with the current colors.

 > $\mathrm{plot}\left(\left[\mathrm{seq}\left(i+\mathrm{sin}\left(x\right),i=1..4\right)\right],x=0..4\mathrm{\pi }\right)$

Set colors to the "Spring" palette, and plot a set of curves.

 > $\mathrm{setcolors}\left("Spring"\right)$
 $\left[{"BlueViolet"}{,}{"Coral"}\right]$ (3)
 > $\mathrm{plot}\left(\left[\mathrm{seq}\left(i+\mathrm{sin}\left(x\right),i=1..4\right)\right],x=0..4\mathrm{\pi }\right)$

Reset to the default colors.

 > $\mathrm{setcolors}\left("Default"\right)$
 $\left[{"#0074CC"}{,}{"#CC0074"}{,}{"#74CC00"}{,}{"#00CCBE"}{,}{"#5800CC"}{,}{"#4B7EA6"}{,}{"#C1CC00"}{,}{"#CC004E"}{,}{"#0041CC"}{,}{"#4BA673"}{,}{"#CC7E00"}{,}{"#BE00CC"}{,}{"#00CC33"}{,}{"#00A7CC"}{,}{"#9BA64B"}{,}{"#4BA6A6"}\right]$ (4)

Compatibility

 • The plots[setcolors] command was updated in Maple 16.