Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Bug summary
As found in#27450, theX
/Y
arguments topcolorfast
do not support units.
Code for reproduction
importdatetimeimportnumpyasnpimportmatplotlib.pyplotaspltnp.random.seed(19680801)basedate_x=datetime.datetime(2023,12,6,1,30,30)basedate_y=datetime.datetime(2024,5,5,12,15,45)dates_x= [basedate_x+datetime.timedelta(days=1*i,hours=6*i,minutes=20*i)foriinrange(10)]dates_y= [basedate_y+datetime.timedelta(days=1*i,hours=8*i,minutes=30*i)foriinrange(10)]data=np.random.rand(0,100)fig,ax=plt.subplots()pc=ax.pcolorfast(dates_x,dates_y,data)
Actual outcome
Traceback (mostrecentcalllast):File"/home/elliott/code/matplotlib/pcolorfast.py",line19,in<module>pc=ax.pcolorfast(dates_x,dates_y,data)File"/home/elliott/code/matplotlib/lib/matplotlib/__init__.py",line1472,ininnerreturnfunc(File"/home/elliott/code/matplotlib/lib/matplotlib/axes/_axes.py",line6527,inpcolorfastself.update_datalim(np.array([[xl,yb], [xr,yt]]))File"/home/elliott/code/matplotlib/lib/matplotlib/axes/_base.py",line2503,inupdate_datalimifnotnp.any(np.isfinite(xys)):TypeError:ufunc'isfinite'notsupportedfortheinputtypes,andtheinputscouldnotbesafelycoercedtoanysupportedtypesaccordingtothecastingrule''safe''
Expected outcome
A plot similar topcolormesh
, with dates on the x/y axis.
Additional information
No response
Operating system
No response
Matplotlib Version
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
git checkout