Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Strange behavior of extended contourf colors in a figure with multiple axes #13038

Copy link
Copy link
Closed
@alexlimonov

Description

@alexlimonov
Issue body actions

I am creating a figure with 6 filled contour plots and a color bar (so, 7 axes total). The function creating the figure loops over a list of variable pairs and arranges the axes in 3x2 pattern with colorbar at the bottom, with a call to figure.colorbar at the end taking the last contourf call's output as leading input.

The problem - all out-of-range colors appear to be colored in as the "adjacent" color in the colorbar, except for the very last contourf plot, which seems to work as expected. But, commenting out the line that creates the colorbar results in the last plot also being broken (no "extended" colors).

All of the calls to contourf (inside of the loop) look like this; the levels and corresponding colors are fixed
plot = axes.contourf(aggregates_xs, aggregates_ys, aggregates_zs, color_levels, colors = color_values, extend = 'both'
plot.cmap.set_over('red')
plot.cmap.set_under('blue')

matplotlib version 3.0.2 (same behavior in 2.0.2, but I didn't guess to try removing the colorbar before updating)

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: inactiveMarked by the “Stale” Github ActionMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.