Post · 1 min read· pp. 981–982

aerosandbox.tools.pretty_plots.plots.plot_color_by_value

Attributes

Functions

plot_color_by_value(x, y, *args, c[, cmap, colorbar, ...])Uses same syntax as matplotlib.pyplot.plot, except that c is now an array-like that maps to a specific color

Module Contents

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) : 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.

code
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:

aerosandbox.tools.pretty_plots.plots.plot_color_by_value.x