Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b637f41 commit fa79e3dCopy full SHA for fa79e3d
lib/matplotlib/colors.py
@@ -1368,8 +1368,14 @@ def inverse(self, value):
1368
def autoscale(self, A):
1369
"""Set *vmin*, *vmax* to min, max of *A*."""
1370
A = np.asanyarray(A)
1371
- self.vmin = A.min()
1372
- self.vmax = A.max()
+ # Ensure that A has non-zero size to compute min/max.
+ # Otherwise put in filler values.
1373
+ if A.size:
1374
+ self.vmin = A.min()
1375
+ self.vmax = A.max()
1376
+ else:
1377
+ self.vmin = 0.0
1378
+ self.vmax = 0.0
1379
1380
def autoscale_None(self, A):
1381
"""If vmin or vmax are not set, use the min/max of *A* to set them."""
0 commit comments