Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
astrofrog opened this issue Mar 29, 2019 · 1 comment
Closed

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

astrofrog opened this issue Mar 29, 2019 · 1 comment

Comments

@astrofrog
Copy link
Contributor

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
@ImportanceOfBeingErnest ImportanceOfBeingErnest added this to the v3.2.0 milestone Mar 30, 2019
@tacaswell tacaswell modified the milestones: v3.2.0, needs sorting Sep 10, 2019
henryhu123 added a commit to CSCD01-team20/matplotlib that referenced this issue Mar 10, 2020
DennisTismenko added a commit to CSCD01-team20/matplotlib that referenced this issue Mar 10, 2020
DennisTismenko pushed a commit to CSCD01-team20/matplotlib that referenced this issue Mar 11, 2020
New test cases for errorbar color with invalid points.
DennisTismenko added a commit to CSCD01-team20/matplotlib that referenced this issue Mar 11, 2020
DennisTismenko pushed a commit to CSCD01-team20/matplotlib that referenced this issue Mar 11, 2020
DennisTismenko pushed a commit to CSCD01-team20/matplotlib that referenced this issue Mar 12, 2020
Combine array masks rather than deleting masked points to maintain
consistency across the project.

Add appropriate test cases for validating color correctness for hlines
and vlines.

Fixes issue matplotlib#13799.
DennisTismenko pushed a commit to CSCD01-team20/matplotlib that referenced this issue Mar 13, 2020
Combine array masks rather than deleting masked points to maintain
consistency across the project.

Add appropriate test cases for validating color correctness for hlines
and vlines.

Fixes issue matplotlib#13799.
DennisTismenko pushed a commit to CSCD01-team20/matplotlib that referenced this issue Mar 13, 2020
Combine array masks rather than deleting masked points to maintain
consistency across the project.

Add appropriate test cases for validating color correctness for hlines
and vlines.

Fixes issue matplotlib#13799.
DennisTismenko pushed a commit to CSCD01-team20/matplotlib that referenced this issue Mar 13, 2020
Combine array masks rather than deleting masked points to maintain
consistency across the project.

Add appropriate test cases for validating color correctness for hlines
and vlines.

Fixes issue matplotlib#13799.
DennisTismenko pushed a commit to CSCD01-team20/matplotlib that referenced this issue Mar 13, 2020
Combine array masks rather than deleting masked points to maintain
consistency across the project.

Add appropriate test cases for validating color correctness for hlines
and vlines.

Fixes issue matplotlib#13799.
timhoffm pushed a commit that referenced this issue Mar 22, 2020
* Resolve inconsistent NaN handling behaviour

Combine array masks rather than deleting masked points to maintain
consistency across the project.

Add appropriate test cases for validating color correctness for hlines
and vlines.

Fixes issue #13799.

* Fix test cases based on feedback

* Improved test cases

* Refactor masked vertices creation

* Refactor hlines and vlines

Co-authored-by: Dennis Tismenko <dtismenkodeveloper@gmail.com>
@timhoffm
Copy link
Member

timhoffm commented Mar 22, 2020

Closed by #16724.

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

No branches or pull requests

4 participants