aerosandbox.tools.pretty_plots.plots.plot_color_by_value
#
Module Contents#
Functions#
|
Uses same syntax as matplotlib.pyplot.plot, except that c is now an array-like that maps to a specific color |
Attributes#
- aerosandbox.tools.pretty_plots.plots.plot_color_by_value.plot_color_by_value(x, y, *args, c, cmap='turbo', colorbar=False, colorbar_label=None, clim=None, **kwargs)[source]#
Uses same syntax as matplotlib.pyplot.plot, except that c is now an array-like that maps to a specific color pulled from cmap. Makes lines that are multicolored based on this c value.
- Parameters:
x (numpy.ndarray) – Array of x-points.
y (numpy.ndarray) – Array of y-points.
*args – Args that will be passed into matplotlib.pyplot.plot(). Example: “.-” for a dotted line.
c (numpy.ndarray) – Array of values that will map to colors. Must be the same length as x and y.
cmap – The colormap to use.
colorbar (bool) – Whether or not to display the colormap. [bool]
colorbar_label (str) – The label to add to the colorbar. Only applies if the colorbar is created. [str]
clim (Tuple[float, float]) – A tuple of (min, max) that assigns bounds to the colormap. Computed from the range of c if not given.
**kwargs – Kwargs that will be passed into matplotlib.pyplot.plot()
Returns: