Skip to content

BUG: incorrect error bar colors when NaN values are present #13799

Closed

Description

@astrofrog

Bug report

Bug summary

When using variable colors for error bars, the colors are incorrect/shifted if NaN values are present.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt

x = [1, np.nan, 3, 4, 5]
colors = ['red', 'green', 'blue', 'purple', 'orange']

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.scatter(x, x, c=colors, s=100)
ax.errorbar(x, x, xerr=0.2, yerr=0.2, ecolor=colors, fmt='none')
fig.savefig('errorbar_colors.png')

Actual outcome

errorbar_colors

Expected outcome

errorbar_colors

Matplotlib version

  • Operating system: MacOS X 10.14.2
  • Matplotlib version: 3.0.3 (from pip)
  • Matplotlib backend: Agg
  • Python version: 3.7.1

Activity

  1. added a commit that references this issue on Mar 10, 2020
    8e9b3cc
  2. timhoffm commented on Mar 22, 2020

    @timhoffm
    Member

    Closed by #16724.

  3. modified the milestones: needs sorting, v3.3.0 on Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions