Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Closed
Milestone
Description
Bug report
Bug summary
QuadMesh.get_clim() is documented as:
Return the values (min, max) that are mapped to the colormap limits.
Withoutvmin orvmax arguments topcolormesh, this returns the data minimal and maximal values. However in the presence of only one ofvmin orvmax, a change occurred between 3.2.2 and 3.3.0rc1. In 3.3.0rc1 it returns the input vminand vmax, though only one of them was specified. The provided examples also happens (with slight output changes) for settingvmax instead of vmin.
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotaspltdx,dy=0.15,0.05y,x=np.mgrid[slice(-3,3+dy,dy),slice(-3,3+dx,dx)]z= (1-x/2.+x**5+y**3)*np.exp(-x**2-y**2)z=z[:-1, :-1]f,ax=plt.subplots(1,1)ax.pcolormesh(x,y,z,vmin=0)ax.axis([x.min(),x.max(),y.min(),y.max()])formeshinax.collections:print(mesh.get_clim())
Actual outcome
# 3.3.0rc1(0.0, None)Expected outcome
# 3.2.2(0.0, 1.0510083319982622)Matplotlib version
- Operating system: MacOSX
- Matplotlib version: 3.3.0rc1
- Matplotlib backend (
print(matplotlib.get_backend())): MacOSX - Python version: 3.8.3
Installed using pip