Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
From my SciPy 2017 talk, the combination of pint.Quantity for unit support with masked arrays produces problems not seen with either individually:
%matplotlibinlineimportmatplotlib.pyplotaspltimportnumpyasnpimportpintunits=pint.UnitRegistry()data=np.random.randn(30,)data_units=data*units.metersdata_masked=np.ma.array(data,mask=data<0.)data_masked_units=data_masked*units.metersfig,axes=plt.subplots(1,3,sharex=True,sharey=True,figsize=(8,4))axes[0].plot(data_units)axes[1].plot(data_masked)axes[2].plot(data_masked_units)
produces: