PlasmaCalcs.plotting.plot_tools.colors.cmap
- PlasmaCalcs.plotting.plot_tools.colors.cmap(based_on=None, N=None, *, colors=None, name=None, reversed=False, under=NO_VALUE, over=NO_VALUE, bad=NO_VALUE, **kw_init)
- Get a Colormap instance, possibly based on a default colormap from matplotlib.
- based_on: matplotlib.colors.Colormap, str, or None
- the colormap to base the result on.None –> use the default colormap (from matplotlib rc; image.cmap)(or, if colors are provided, use colors to make a new colormap instead).str –> use the colormap with this name from matplotlib.(or, if colors are provided, set this to the name of the new colormap).Colormap –> base the result on this colormap.(mutually exclusive with providing a value for colors)
- N: None or int
- number of colors to use.None –> use the number of colors in based_on.int –> resample to this many colors.
- colors: None or array-like of colors
- None –> ignore this parameterarray-like –> provide these to make a new Colormap.(mutually exclusive with providing a Colormap for based_on)
- name: None or str
- the name for the new Colormap.if None, infer name from the old colormap or the provided value of based_on.
- reversed: bool
- whether to return result.reversed(), instead.
- under: NO_VALUE, None, str, or other specifier for a color.
- the color for low out-of-range values.if provided (not NO_VALUE), sets result.under = under.
- over: NO_VALUE, None, str, or other specifier for a color.
- the color for high out-of-range values.if provided (not NO_VALUE), sets result.over = over.
- bad: NO_VALUE, None, str, or other specifier for a color.
- the color for masked values.if provided (not NO_VALUE), sets result.bad = bad.
additional kwargs are passed to cls(…) when creating the result.