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 4dbbd22 commit 961742cCopy full SHA for 961742c
lib/matplotlib/colorbar.py
@@ -1069,7 +1069,8 @@ class Colorbar(ColorbarBase):
1069
def __init__(self, ax, mappable, **kw):
1070
# Ensure the given mappable's norm has appropriate vmin and vmax set
1071
# even if mappable.draw has not yet been called.
1072
- mappable.autoscale_None()
+ if mappable.get_array() is not None:
1073
+ mappable.autoscale_None()
1074
1075
self.mappable = mappable
1076
kw['cmap'] = cmap = mappable.cmap
0 commit comments