@@ -537,10 +537,9 @@ def make_image(self, renderer, magnification=1.0, unsampled=False):
537537
538538 def _draw_unsampled_image (self , renderer , gc ):
539539 """
540- draw unsampled image. The renderer should support a draw_image method
540+ Draw unsampled image. The renderer should support a draw_image method
541541 with scale parameter.
542542 """
543-
544543 im , l , b , trans = self .make_image (renderer , unsampled = True )
545544
546545 if im is None :
@@ -552,7 +551,8 @@ def _draw_unsampled_image(self, renderer, gc):
552551
553552 def _check_unsampled_image (self , renderer ):
554553 """
555- return True if the image is better to be drawn unsampled.
554+ Return whether the image is better to be drawn unsampled.
555+
556556 The derived class needs to override it.
557557 """
558558 return False
@@ -852,12 +852,20 @@ def _check_unsampled_image(self, renderer):
852852
853853 def set_extent (self , extent ):
854854 """
855- extent is data axes (left, right, bottom, top) for making image plots
855+ Set the image extent.
856856
857- This updates ax.dataLim, and, if autoscaling, sets viewLim
858- to tightly fit the image, regardless of dataLim. Autoscaling
857+ Parameters
858+ ----------
859+ extent : 4-tuple of float
860+ The position and size of the image as tuple
861+ ``(left, right, bottom, top)`` in data coordinates.
862+
863+ Notes
864+ -----
865+ This updates ``ax.dataLim`, and, if autoscaling, sets ``ax.viewLim``
866+ to tightly fit the image, regardless of ``dataLim``. Autoscaling
859867 state is not changed, so following this with ax.autoscale_view
860- will redo the autoscaling in accord with dataLim.
868+ will redo the autoscaling in accord with `` dataLim`` .
861869 """
862870 self ._extent = xmin , xmax , ymin , ymax = extent
863871 corners = (xmin , ymin ), (xmax , ymax )
@@ -871,7 +879,7 @@ def set_extent(self, extent):
871879 self .stale = True
872880
873881 def get_extent (self ):
874- """Get the image extent: left, right, bottom, top"""
882+ """Return the image extent as tuple ( left, right, bottom, top). """
875883 if self ._extent is not None :
876884 return self ._extent
877885 else :
@@ -923,17 +931,18 @@ def format_cursor_data(self, data):
923931class NonUniformImage (AxesImage ):
924932 def __init__ (self , ax , * , interpolation = 'nearest' , ** kwargs ):
925933 """
926- kwargs are identical to those for AxesImage, except
927- that 'nearest' and 'bilinear' are the only supported 'interpolation'
928- options.
934+ Parameters
935+ ----------
936+ interpolation : {'nearest', 'bilinear'}
937+
938+ **kwargs
939+ All other keyword arguments are identical to those of `.AxesImage`.
929940 """
930941 super ().__init__ (ax , ** kwargs )
931942 self .set_interpolation (interpolation )
932943
933944 def _check_unsampled_image (self , renderer ):
934- """
935- return False. Do not use unsampled image.
936- """
945+ """Return False. Do not use unsampled image."""
937946 return False
938947
939948 def make_image (self , renderer , magnification = 1.0 , unsampled = False ):
@@ -1204,7 +1213,7 @@ def __init__(self, fig,
12041213 self .magnification = 1.0
12051214
12061215 def get_extent (self ):
1207- """Get the image extent: left, right, bottom, top"""
1216+ """Return the image extent as tuple ( left, right, bottom, top). """
12081217 numrows , numcols = self .get_size ()
12091218 return (- 0.5 + self .ox , numcols - 0.5 + self .ox ,
12101219 - 0.5 + self .oy , numrows - 0.5 + self .oy )
0 commit comments