Overview - Maple Help

Color Collections and Colormaps for use with plots

 Description  Plot Colors Collections  Color Dictionaries  Colormap collections

Description

• The ColorTools package defines a large number of color collections. They are generally of three types

• Palettes of discrete colors for use in plots and charts

• Dictionaries of color names

• Continuous colormaps for use in coloring surfaces

• The full set of known colors can be returned with PaletteNames.

 > with(ColorTools): with(plots):

 > PaletteNames();

 (1)

Plot Colors Collections

• The default plotting colors of are in the Niagara palette. It is especially designed for coloring line and curves.

 > Swatches("Niagara");

• Two other palettes are also designed for lines and curves: Spring which is brighter and Nautical which is darker.

 > display(<       Swatches("Spring", title="Spring") |       Swatches("Nautical", title="Nautical") > );

• Any of these collections can be chosen as the default set of colors used by plot, using the plots:-setcolors command.

 > plot([seq(sin(x+i*Pi/16), i = 1 .. 16)], x = 0 .. 2*Pi, axes = boxed, numpoints = 25, style = line, size=[800,450], title="Niagara Colors");

 > plots:-setcolors("Spring"):

 > plot([seq(sin(x+i*Pi/16), i = 1 .. 16)], x = 0 .. 2*Pi, axes = boxed, numpoints = 25, style = line, size=[800,450], title="Spring Colors");

• There are three palettes designed for shapes and filled areas, they are generally more saturated than the collections for lines: Bright is the most saturated, Executive is the most pale and Patchwork is somewhere inbetween, chose to have prominent orange, red, and yellow. Additionally there is a Mono Color Palette consisting only of shades of gray.

 > display( <       Swatches("Bright", title="Bright") |       Swatches("Executive", title="Executive") |       Swatches("Patchwork", title="Patchwork" ) > );

• Most of the above collections were created with 8-10 carefully selected colors, but via the ExpandPalette command they have been extended to 16 colors, since that is default used by setcolors. Their Palette objects will also automatically generate additional colors on demand

 > Color("Niagara 17"), Color("Bright 17"), Color("Patchwork 11");

 (2)

• There is a palette for legacy use, replicating the colors used in versions of Maple 15 and prior. It is the only plot palette that does not expand.

 > Swatches("OldPlots");

• Finally, there are two collections of colors useful for users with various forms of color vision deficiency. The Dalton and CVD Color Palette are both good for users with deuteranopia and protanopia. And the first nine colors of the CVD palette should be distinguishable by viewers with tritanopia. optimized for protanopia and tritanopia respectively.

 > display( <   Swatches("Dalton", title="Dalton") |   Swatches("CVD", title="CVD") > );

• Additionally, the "CVD2" and "CVD3" palettes use the same colors as the CVD palette, but designed to generate new colors optimized for protanopia and tritanopia respectively.

 > display( <   Swatches([seq(cat("CVD ",i), i=1..16)], title="CVD") |   Swatches([seq(cat("CVD2 ",i), i=1..16)], title="CVD2") |   Swatches([seq(cat("CVD3 ",i), i=1..16)], title="CVD3") > );

Color Dictionaries

• Color dictionaries are meant to be useful references for common colors. Swatched for each are shown below, but the are generally more interesting for their mappings of names to colors which can be found on their individually linked help pages.

• The HTML Color Palette, CSS Color Palette, and X11 Color Palette are all standard color name mappings. The "HTML" colors are, in fact, the default used for color name look up.

 > display( <   Swatches("HTML", title="HTML") |   Swatches("CSS", title="CSS") |   Swatches("X11", title="X11" ) > );

• The MapleV Color Palette is a reference for the 24 "old" colors used in Maple prior to the ColorTools package and support of the HTML color names. The Solarized color palette is a pleasing colorscheme for text highlighting. The BeerSRM palette is a standard scale of colors of styles of beer, it can also be used as a colormap.

 > display( <   Swatches("MapleV", title="MapleV") |   Swatches("Solarized", title="Solarized") |   Swatches("BeerSRM", title="BeerSRM" ) > );

• The xterm color palette is all 256 colors supported by Unix xterms which do not exactly match the X11 colors. The Generic Color Palette is an an imperfect reverse mapping of the ColorDescription command, it includes a representave sample of every possible output of that command.

 > display( <   Swatches("xterm", title="xterm") |   Swatches("Generic", title="Generic", rows=30) > );

• The xkcd Color Palette is a set of crowdsourced names of colors distributed across the sRGB gammut.  The Resene Color Palette is a collection of whimsically named colors used for paint.

 > display( <   Swatches("xkcd", title="xkcd") |   Swatches("Resene", title="Resene") > );

Colormap collections

• Colormaps are designed as a continuous range of colors and are useful for densityplot, and plot3d surfaces, or any situation where a surface is to be variably shaded to represent an additional variable.  By default the almost all start from blue/black and tend to red/yellow.

• The following four linear colormaps were developed for Python and used commonly in many visualization tools: Inferno, Magma, Plasma, and Viridis. They were constructed to change in a perceptually uniform way from dark be accessible to users with CVD.

 > display( << Swatches("Inferno", mode=gradient, title="Inferno") |   Swatches("Magma", mode=gradient, title="Magma")> ;   ;  Color("Gs", c)), title="Viridis Grayscale") > >);

• There is a fifth linear colormap called Cividis which is a variation of Viridis to match watch a viewer with deuteranopia would see.

• The Colorwheel, Isocircle, and Twilight colormaps are all cyclical for applications where the data is periodic. Colorwheel starts and ends with a relatively dark color, Twilight starts and ends with a relatively light color, and Isocircle consists of colors of the same lightness.

 > display(<   < Swatches("Colorwheel", mode=wheel, title="Colorwheel") |     Swatches("Isocircle", mode=wheel, title="Isocircle") |     Swatches("Twilight", mode=wheel, title="Twilight") > ;   < Swatches("Colorwheel", mode=gradient) |     Swatches("Isocircle", mode=gradient) |     Swatches("Twilight", mode=gradient) >;   < Swatches("Colorwheel", mode=gradient, filter=(c->Color("Gs",c))) |     Swatches("Isocircle", mode=gradient, filter=(c->Color("Gs",c))) |     Swatches("Twilight", mode=gradient, filter=(c->Color("Gs",c))) > >);

• The colormaps Turbo, Coolwarm, DivergeBJY, DivergeBKR, DivergeBKY, DivergeBWY, DivergeGWV, and DivergeRainbow are all designed to emphasize variation from a central value with perceived lightness.  Most commonly light in the center are dark to the edges

 > display(<   < Swatches("Coolwarm", mode=gradient, title="Coolwarm") |     Swatches("DivergeBWY", mode=gradient, title="DivergeBWY")> ;   < Swatches("DivergeBJY", mode=gradient, title="DivergeBJY") |     Swatches("DivergeGWV", mode=gradient, title="DivergeGWV") > ;   < Swatches("DivergeBJY", mode=gradient, filter=CVDSimulation, title="DivergeBJY CVD Simulation") |     Swatches("DivergeGWV", mode=gradient, filter=(c->Color("Gs", c)), title="DivergeGWV Grayscale") > >);

• But also dark in the center and light to the edges

 > display( <   < Swatches("DivergeBKR", mode=gradient, title="DivergeBKR") |     Swatches("DivergeBKY", mode=gradient, title="DivergeBKY")> ;   < Swatches("DivergeBKY", mode=gradient, filter=(c->Color("Gs", c)), title="DivergeBKR Greyscale") |     Swatches("DivergeBKY", mode=gradient, filter=CVDSimulation, title="DivergeBKY CVD Simulation")> > );

• The colormaps Turbo and DivergeRainbow are both multihued maps that tend from light in the center but dark at the edges. They are intended to give a pleasing rainbow appearance while minimizing the appearance of false features that can arise from rainbow maps.

 > display( <   < Swatches("Turbo", mode=gradient, title="Turbo") |     Swatches("Turbo", mode=gradient, filter=(c->Color("Gs", c)), title="Turbo Greyscale") > ;   < Swatches("DivergeRainbow", mode=gradient, title="DivergeRainbow") |     Swatches("DivergeRainbow", mode=gradient, filter=(c->Color("Gs", c)), title="DivergeRainbow Greyscale") > > );

• The Isoluminant color map is a multihued map with no lightness variation, it is intended to emphasize spatial variation of a surface. The Rainbow colormap is a more traditionally spaced rainbow that is not suitable to use as a divergent map.

 > display( <   < Swatches("Isoluminant", mode=gradient, title="Isoluminant") |     Swatches("Isoluminant", mode=gradient, filter=(c->Color("Gs", c)), title="Isoluminant Greyscale") > ;   < Swatches("Rainbow", mode=gradient, title="Rainbow") |     Swatches("Rainbow", mode=gradient, filter=(c->Color("Gs", c)), title="Rainbow Greyscale") > > );

• All palettes can be used via the colormap option to plots, but colormaps are especially well suited.

 > densityplot( sin(x)+cos(y), x=-2*Pi..2*Pi, y=-2*Pi..2*Pi, colormap="DivergeRainbow");

 > plot3d( sin(x)+cos(y), x=-2*Pi..2*Pi, y=-2*Pi..2*Pi, colormap="Isoluminant");