@@ -906,8 +906,10 @@ def cla(self):
906906 self .containers = []
907907
908908 self .grid (self ._gridOn , which = rcParams ['axes.grid.which' ])
909- props = font_manager .FontProperties (size = rcParams ['axes.titlesize' ],
910- weight = rcParams ['axes.titleweight' ])
909+ props = font_manager .FontProperties (
910+ size = rcParams ['axes.titlesize' ],
911+ weight = rcParams ['axes.titleweight' ]
912+ )
911913
912914 self .titleOffsetTrans = mtransforms .ScaledTranslation (
913915 0.0 , 5.0 / 72.0 , self .figure .dpi_scale_trans )
@@ -1179,7 +1181,7 @@ def apply_aspect(self, position=None):
11791181 else :
11801182 A = aspect
11811183
1182- #Ensure at drawing time that any Axes involved in axis-sharing
1184+ # Ensure at drawing time that any Axes involved in axis-sharing
11831185 # does not have its position changed.
11841186 if self in self ._shared_x_axes or self in self ._shared_y_axes :
11851187 if self ._adjustable == 'box' :
@@ -1218,10 +1220,8 @@ def apply_aspect(self, position=None):
12181220 data_ratio = box_aspect / A
12191221
12201222 y_expander = (data_ratio * xsize / ysize - 1.0 )
1221- #print 'y_expander', y_expander
12221223 # If y_expander > 0, the dy/dx viewLim ratio needs to increase
12231224 if abs (y_expander ) < 0.005 :
1224- #print 'good enough already'
12251225 return
12261226
12271227 if aspect_scale_mode == "log" :
@@ -1241,30 +1241,25 @@ def apply_aspect(self, position=None):
12411241 Xsize = ysize / data_ratio
12421242 Xmarg = Xsize - xr
12431243 Ymarg = Ysize - yr
1244- xm = 0 # Setting these targets to, e.g., 0.05*xr does not seem to
1245- # help.
1244+ xm = 0 # Setting these targets to, e.g., 0.05*xr does not seem to help
12461245 ym = 0
1247- #print 'xmin, xmax, ymin, ymax', xmin, xmax, ymin, ymax
1248- #print 'xsize, Xsize, ysize, Ysize', xsize, Xsize, ysize, Ysize
12491246
1250- changex = (self in self ._shared_y_axes
1251- and self not in self ._shared_x_axes )
1252- changey = (self in self ._shared_x_axes
1253- and self not in self ._shared_y_axes )
1247+ changex = (self in self ._shared_y_axes and
1248+ self not in self ._shared_x_axes )
1249+ changey = (self in self ._shared_x_axes and
1250+ self not in self ._shared_y_axes )
12541251 if changex and changey :
12551252 warnings .warn ("adjustable='datalim' cannot work with shared "
12561253 "x and y axes" )
12571254 return
12581255 if changex :
12591256 adjust_y = False
12601257 else :
1261- #print 'xmarg, ymarg, Xmarg, Ymarg', xmarg, ymarg, Xmarg, Ymarg
12621258 if xmarg > xm and ymarg > ym :
1263- adjy = ((Ymarg > 0 and y_expander < 0 )
1264- or (Xmarg < 0 and y_expander > 0 ))
1259+ adjy = ((Ymarg > 0 and y_expander < 0 ) or
1260+ (Xmarg < 0 and y_expander > 0 ))
12651261 else :
12661262 adjy = y_expander > 0
1267- #print 'y_expander, adjy', y_expander, adjy
12681263 adjust_y = changey or adjy # (Ymarg > xmarg)
12691264 if adjust_y :
12701265 yc = 0.5 * (ymin + ymax )
@@ -1274,8 +1269,6 @@ def apply_aspect(self, position=None):
12741269 self .set_ybound ((10. ** y0 , 10. ** y1 ))
12751270 else :
12761271 self .set_ybound ((y0 , y1 ))
1277- #print 'New y0, y1:', y0, y1
1278- #print 'New ysize, ysize/xsize', y1-y0, (y1-y0)/xsize
12791272 else :
12801273 xc = 0.5 * (xmin + xmax )
12811274 x0 = xc - Xsize / 2.0
@@ -1284,8 +1277,6 @@ def apply_aspect(self, position=None):
12841277 self .set_xbound ((10. ** x0 , 10. ** x1 ))
12851278 else :
12861279 self .set_xbound ((x0 , x1 ))
1287- #print 'New x0, x1:', x0, x1
1288- #print 'New xsize, ysize/xsize', x1-x0, ysize/(x1-x0)
12891280
12901281 def axis (self , * v , ** kwargs ):
12911282 """
@@ -1402,7 +1393,7 @@ def get_yticklines(self):
14021393 return cbook .silent_list ('Line2D ytickline' ,
14031394 self .yaxis .get_ticklines ())
14041395
1405- #### Adding and tracking artists
1396+ # Adding and tracking artists
14061397
14071398 def _sci (self , im ):
14081399 """
@@ -1588,7 +1579,7 @@ def _update_patch_limits(self, patch):
15881579 xys = patch .get_patch_transform ().transform (vertices )
15891580 if patch .get_data_transform () != self .transData :
15901581 patch_to_data = (patch .get_data_transform () -
1591- self .transData )
1582+ self .transData )
15921583 xys = patch_to_data .transform (xys )
15931584
15941585 updatex , updatey = patch .get_transform ().\
@@ -1689,26 +1680,22 @@ def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
16891680 if self .xaxis is None or self .yaxis is None :
16901681 return
16911682
1692- #print 'processing', self.get_geometry()
16931683 if xdata is not None :
16941684 # we only need to update if there is nothing set yet.
16951685 if not self .xaxis .have_units ():
16961686 self .xaxis .update_units (xdata )
1697- #print '\tset from xdata', self.xaxis.units
16981687
16991688 if ydata is not None :
17001689 # we only need to update if there is nothing set yet.
17011690 if not self .yaxis .have_units ():
17021691 self .yaxis .update_units (ydata )
1703- #print '\tset from ydata', self.yaxis.units
17041692
17051693 # process kwargs 2nd since these will override default units
17061694 if kwargs is not None :
17071695 xunits = kwargs .pop ('xunits' , self .xaxis .units )
17081696 if self .name == 'polar' :
17091697 xunits = kwargs .pop ('thetaunits' , xunits )
17101698 if xunits != self .xaxis .units :
1711- #print '\tkw setting xunits', xunits
17121699 self .xaxis .set_units (xunits )
17131700 # If the units being set imply a different converter,
17141701 # we need to update.
@@ -1719,7 +1706,6 @@ def _process_unit_info(self, xdata=None, ydata=None, kwargs=None):
17191706 if self .name == 'polar' :
17201707 yunits = kwargs .pop ('runits' , yunits )
17211708 if yunits != self .yaxis .units :
1722- #print '\tkw setting yunits', yunits
17231709 self .yaxis .set_units (yunits )
17241710 # If the units being set imply a different converter,
17251711 # we need to update.
@@ -1937,7 +1923,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
19371923 if scalex and self ._autoscaleXon :
19381924 xshared = self ._shared_x_axes .get_siblings (self )
19391925 dl = [ax .dataLim for ax in xshared ]
1940- #ignore non-finite data limits if good limits exist
1926+ # ignore non-finite data limits if good limits exist
19411927 finite_dl = [d for d in dl if np .isfinite (d ).all ()]
19421928 if len (finite_dl ):
19431929 dl = finite_dl
@@ -1963,7 +1949,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
19631949 if scaley and self ._autoscaleYon :
19641950 yshared = self ._shared_y_axes .get_siblings (self )
19651951 dl = [ax .dataLim for ax in yshared ]
1966- #ignore non-finite data limits if good limits exist
1952+ # ignore non-finite data limits if good limits exist
19671953 finite_dl = [d for d in dl if np .isfinite (d ).all ()]
19681954 if len (finite_dl ):
19691955 dl = finite_dl
@@ -1984,7 +1970,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
19841970 y0 , y1 = ylocator .view_limits (y0 , y1 )
19851971 self .set_ybound (y0 , y1 )
19861972
1987- #### Drawing
1973+ # Drawing
19881974
19891975 @allow_rasterization
19901976 def draw (self , renderer = None , inframe = False ):
@@ -2056,7 +2042,7 @@ def draw(self, renderer=None, inframe=False):
20562042 # if the minimum zorder is negative, start rasterization
20572043 rasterization_zorder = self ._rasterization_zorder
20582044 if (rasterization_zorder is not None and
2059- len (dsu ) > 0 and dsu [0 ][0 ] < rasterization_zorder ):
2045+ len (dsu ) > 0 and dsu [0 ][0 ] < rasterization_zorder ):
20602046 renderer .start_rasterizing ()
20612047 dsu_rasterized = [l for l in dsu if l [0 ] < rasterization_zorder ]
20622048 dsu = [l for l in dsu if l [0 ] >= rasterization_zorder ]
@@ -2133,7 +2119,7 @@ def redraw_in_frame(self):
21332119 def get_renderer_cache (self ):
21342120 return self ._cachedRenderer
21352121
2136- #### Axes rectangle characteristics
2122+ # Axes rectangle characteristics
21372123
21382124 def get_frame_on (self ):
21392125 """
@@ -2430,7 +2416,7 @@ def set_axis_bgcolor(self, color):
24302416 self ._axisbg = color
24312417 self .patch .set_facecolor (color )
24322418
2433- ### data limits, ticks, tick labels, and formatting
2419+ # data limits, ticks, tick labels, and formatting
24342420
24352421 def invert_xaxis (self ):
24362422 "Invert the x-axis."
@@ -2575,7 +2561,7 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False, **kw):
25752561 other .set_xlim (self .viewLim .intervalx ,
25762562 emit = False , auto = auto )
25772563 if (other .figure != self .figure and
2578- other .figure .canvas is not None ):
2564+ other .figure .canvas is not None ):
25792565 other .figure .canvas .draw_idle ()
25802566
25812567 return left , right
@@ -2910,8 +2896,8 @@ def get_yticklabels(self, minor=False, which=None):
29102896 List of :class:`~matplotlib.text.Text` instances.
29112897 """
29122898 return cbook .silent_list ('Text yticklabel' ,
2913- self .yaxis .get_ticklabels (minor = minor ,
2914- which = which ))
2899+ self .yaxis .get_ticklabels (minor = minor ,
2900+ which = which ))
29152901
29162902 @docstring .dedent_interpd
29172903 def set_yticklabels (self , labels , fontdict = None , minor = False , ** kwargs ):
@@ -3004,7 +2990,7 @@ def minorticks_off(self):
30042990 self .xaxis .set_minor_locator (mticker .NullLocator ())
30052991 self .yaxis .set_minor_locator (mticker .NullLocator ())
30062992
3007- #### Interactive manipulation
2993+ # Interactive manipulation
30082994
30092995 def can_zoom (self ):
30102996 """
0 commit comments