@@ -249,7 +249,7 @@ def set_clim(self, vmin=None, vmax=None):
249249 The limits.
250250
251251 For scalar data, the limits may also be passed as a
252- tuple (*vmin*, *vmax*) as a single positional argument.
252+ tuple (*vmin*, *vmax*) single positional argument.
253253
254254 .. ACCEPTS: (vmin: float, vmax: float)
255255 """
@@ -575,14 +575,10 @@ def set_array(self, A):
575575
576576 A = cbook .safe_masked_invalid (A , copy = True )
577577 if not np .can_cast (A .dtype , float , "same_kind" ):
578- if A .dtype .fields is None :
579- raise TypeError (f"Image data of dtype { A .dtype } cannot be "
580- f"converted to float" )
581- else :
582- for key in A .dtype .fields :
583- if not np .can_cast (A [key ].dtype , float , "same_kind" ):
584- raise TypeError (f"Image data of dtype { A .dtype } cannot be "
585- f"converted to a sequence of floats" )
578+ for key in np .atleast_1d (A .dtype .fields ):
579+ if not np .can_cast (A [key ].dtype , float , "same_kind" ):
580+ raise TypeError (f"Image data of dtype { A .dtype } cannot be "
581+ f"converted to a sequence of floats" )
586582
587583 self ._A = A
588584 if not self .norm .scaled ():
@@ -635,7 +631,7 @@ def _get_colorizer(cmap, norm, colorizer):
635631 cmap : str, `~matplotlib.colors.Colormap`, `~matplotlib.colors.BivarColormap`\
636632 or `~matplotlib.colors.MultivarColormap`, default: :rc:`image.cmap`
637633 The Colormap instance or registered colormap name used to map
638- scalar/multivariate data to colors.
634+ data values to colors.
639635
640636 Multivariate data is only accepted if a multivariate colormap
641637 (`~matplotlib.colors.BivarColormap` or `~matplotlib.colors.MultivarColormap`)
@@ -660,13 +656,13 @@ def _get_colorizer(cmap, norm, colorizer):
660656 before mapping to colors using *cmap*. By default, a linear scaling is
661657 used, mapping the lowest value to 0 and the highest to 1.
662658
663- If given, this can be one of the following:
659+ This can be one of the following:
664660
665661 - An instance of `.Normalize` or one of its subclasses
666662 (see :ref:`colormapnorms`).
667663 - A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a
668664 list of available scales, call `matplotlib.scale.get_scale_names()`.
669- In that case, a suitable `.Normalize` subclass is dynamically generated
665+ In this case, a suitable `.Normalize` subclass is dynamically generated
670666 and instantiated.
671667 - A list of scale names or `.Normalize` objects matching the number of
672668 variates in the colormap, for use with `~matplotlib.colors.BivarColormap`
@@ -686,8 +682,8 @@ def _get_colorizer(cmap, norm, colorizer):
686682 *vmin*/*vmax* when a *norm* instance is given (but using a `str` *norm*
687683 name together with *vmin*/*vmax* is acceptable).
688684
689- A list can be used to define independent limits for each variate when
690- using a `~matplotlib.colors.BivarColormap` or
685+ A list of values (vmin or vmax) can be used to define independent limits
686+ for each variate when using a `~matplotlib.colors.BivarColormap` or
691687 `~matplotlib.colors.MultivarColormap`.""" ,
692688)
693689
0 commit comments