tracktable.render.map_decoration.colormaps module

Module contents

Several usable, mostly-accessible color maps for use when rendering points and trajectories

These colormaps are registered with matplotlib so that you can refer to them by name just as you can the standard ones.

tracktable.render.map_decoration.colormaps.make_simple_colormap(color_list, name=None)[source]

Create a colormap by spacing colors evenly from 0 to 1

Take a list of 2 or more colors and space them evenly from 0 to 1. The result will be instantiated as a Matplotlib color map and returned. If you include a name, the color map will also be registered so that you can refer to it with that name instead of needing the object itself.

Note that this function does not handle transparency at all. If you need that capability you will need to work directly with matplotlib.colors.LinearSegmentedColormap.

Colors are supplied to this function as ‘color specifications’. Here’s the documentation of those, borrowed from the documentation for matplotlib.colors.ColorConverter:

  • a letter from the set ‘rgbcmykw’

  • a hex color string, like ‘#0000FF’

  • a standard name, like ‘aqua’

  • a float, like ‘0.4’, indicating gray on a 0-1 scale

Parameters

color_list (list) – List of color specifications (described above)

Keyword Arguments

name (str) – Optional name for the color map for registration

Returns

A new matplotlib colormap object.

Side Effects:

If you specify a value for the ‘name’ parameter then the created colormap will be registered under that name.