Skip to content

Hodograph.plot_colormapped requires units when given colors #2404

@dopplershift

Description

@dopplershift

Right now the docs read:

        u : array_like
            u-component of wind
        v : array_like
            v-component of wind
        c : array_like
            data to use for colormapping (e.g. heights, pressure, wind speed)
        intervals: array-like, optional
            Array of intervals for c to use in coloring the hodograph.

Note, all "array-like". However, if colors is passed:

if colors:
cmap = mcolors.ListedColormap(colors)
# If we are segmenting by height (a length), interpolate the contour intervals
if intervals.check('[length]'):

there we assume intervals has units. At the very least, the docs should match the implementation.

This is different than the rest of the plotting functionality where we are unit agnostic as much as possible (this function is if you're not passing explicit levels). My inclination, then, is that this should be fixed to make the function unit agnostic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: PlotsPertains to producing plotsType: BugSomething is not working like it should

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions