You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the matplotlib handling of missing values has changed in between versions 3.5.2 and 3.2.1.
If one provides a numpy array with np.nan to the matplotlib function errorbar, one would receive an exception in the newest tag, instead of a plot with missing values like in the earlier versions.
The text of exception is misleading, because it does not say anything about NaN values.
Preferable handling of NaNs is to skip the point as it was before.
ax.errorbar(bin_centers,
File "/cvmfs/belle.cern.ch/el7/externals/v01-11-00/Linux_x86_64/common/lib/python3.8/site-packages/matplotlib/__init__.py", line 1412, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/cvmfs/belle.cern.ch/el7/externals/v01-11-00/Linux_x86_64/common/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 3467, in errorbar
barcols.append(lines_func(
File "/cvmfs/belle.cern.ch/el7/externals/v01-11-00/Linux_x86_64/common/lib/python3.8/site-packages/matplotlib/__init__.py", line 1412, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "/cvmfs/belle.cern.ch/el7/externals/v01-11-00/Linux_x86_64/common/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 1063, in hlines
minx = min(xmin.min(), xmax.min())
File "/cvmfs/belle.cern.ch/el7/externals/v01-11-00/Linux_x86_64/common/lib/python3.8/site-packages/numpy/ma/core.py", line 5700, in min
result = self.filled(fill_value).min(
File "/cvmfs/belle.cern.ch/el7/externals/v01-11-00/Linux_x86_64/common/lib/python3.8/site-packages/numpy/core/_methods.py", line 43, in _amin
return umr_minimum(a, axis, None, out, keepdims, initial, where)
TypeError: '<=' not supported between instances of 'float' and 'str'
Expected outcome
A plot with missing points
Additional information
No response
Operating system
Ubuntu
Matplotlib Version
3.5.2
Matplotlib Backend
TkAgg
Python version
Python 3.8.8
Jupyter version
3.1.2
Installation
pip
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Bug summary
Hello,
the matplotlib handling of missing values has changed in between versions 3.5.2 and 3.2.1.
If one provides a numpy array with
np.nan
to the matplotlib functionerrorbar
, one would receive an exception in the newest tag, instead of a plot with missing values like in the earlier versions.The text of exception is misleading, because it does not say anything about NaN values.
Preferable handling of NaNs is to skip the point as it was before.
Code for reproduction
Actual outcome
Expected outcome
A plot with missing points

Additional information
No response
Operating system
Ubuntu
Matplotlib Version
3.5.2
Matplotlib Backend
TkAgg
Python version
Python 3.8.8
Jupyter version
3.1.2
Installation
pip
The text was updated successfully, but these errors were encountered: