Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy