Closed
Description
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
Expected outcome
Matplotlib version
- Operating system: MacOS X 10.14.2
- Matplotlib version: 3.0.3 (from pip)
- Matplotlib backend: Agg
- Python version: 3.7.1