8000 BUG: incorrect error bar colors when NaN values are present · Issue #13799 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
BUG: incorrect error bar colors when NaN values are present #13799
Closed
@astrofrog

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0