Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83f4167

Browse files
trygvradtimhoffm
andauthored
Apply suggestions from code review
Co-authored-by: Tim Hoffmann <[email protected]>
1 parent bb49d49 commit 83f4167

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/matplotlib/colorizer.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,11 @@ def get_clim(self):
373373
Return the values (min, max) that are mapped to the colormap limits.
374374
375375
This function is not available for multivariate data.
376-
Use `.Colorizer.get_clim()` via the .colorizer property instead.
376+
Use `.Colorizer.get_clim` via the .colorizer property instead.
377377
"""
378378
if self._colorizer.norm.n_components > 1:
379-
raise AttributeError("`.get_clim()` is unavailable when using a colormap "
380-
"with multiple components. Use "
381-
"`.colorizer.get_clim()` instead")
379+
raise AttributeError("get_clim() cannot be used with a multi-component "
380+
"colormap. Use .colorizer.get_clim() instead")
382381
return self.colorizer.norm.vmin, self.colorizer.norm.vmax
383382

384383
def set_clim(self, vmin=None, vmax=None):
@@ -400,9 +399,8 @@ def set_clim(self, vmin=None, vmax=None):
400399
# If the norm's limits are updated self.changed() will be called
401400
# through the callbacks attached to the norm
402401
if self._colorizer.norm.n_components > 1:
403-
raise AttributeError("`.set_clim(vmin, vmax)` is unavailable "
404-
"when using a colormap with multiple components. Use "
405-
"`.colorizer.set_clim(vmin, vmax)` instead")
402+
raise AttributeError("set_clim() cannot be used with a multi-component "
403+
"colormap. Use .colorizer.set_clim() instead")
406404
self._colorizer.set_clim(vmin, vmax)
407405

408406
def get_alpha(self):

0 commit comments

Comments
 (0)