Description
Bug report
Bug summary
I am plotting something that requires the use of standard error. I would like to keep all my arrays as Quantities arrays (using astropy quantities in this case). However, when giving yerr an array with dimensions, an exception is thrown.
Code for reproduction
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 10)
y = np.sin(x*np.pi)
yerr = np.random.rand(10)
x_sec = x*u.second
y_meter = y*u.meter
yerr_meter = yerr*u.meter
fig = plt.figure()
ax = fig.add_subplot(111)
ax.errorbar(x_sec, y_meter, yerr_meter)
fig.show()
Expected outcome
It is expected that errorbar would plot the points with errorbars using quantity arrays the same as regular arrays. When yerr is taken out, the quantities plot fine. Simply using yerr_meter.value does not work, as this throws an exception related to subtracting two different quantities (y_meter and yerr). I would rather not have to call .value on all the arguments.
This appears to be related to an issue raised in astropy:
astropy/astropy#3914
Matplotlib version
- Operating System: Windows 10, Scientific Linux 7.2
- Matplotlib Version: 2.0.2
- Python Version: 2.7.12
- Other Libraries: numpy 1.12.1, astropy 1.3.2