@@ -501,12 +501,10 @@ def _add_solids(self, X, Y, C):
501501 self .dividers .remove ()
502502 self .dividers = None
503503 if self .drawedges :
504- self . dividers = collections . LineCollection (
505- self ._edges (X , Y ),
504+ linewidths = ( 0.5 * mpl . rcParams [ 'axes.linewidth' ],)
505+ self . dividers = collections . LineCollection ( self ._edges (X , Y ),
506506 colors = (mpl .rcParams ['axes.edgecolor' ],),
507- linewidths = (
508- 0.5 * mpl .rcParams ['axes.linewidth' ],)
509- )
507+ linewidths = linewidths )
510508 self .ax .add_collection (self .dividers )
511509
512510 def add_lines (self , levels , colors , linewidths , erase = True ):
@@ -725,9 +723,9 @@ def _uniform_y(self, N):
725723 y = np .linspace (0 , 1 , N )
726724 else :
727725 automin = automax = 1. / (N - 1. )
728- extendlength = self ._get_extension_lengths (
729- self . extendfrac ,
730- automin , automax , default = 0.05 )
726+ extendlength = self ._get_extension_lengths (self . extendfrac ,
727+ automin , automax ,
728+ default = 0.05 )
731729 if self .extend == 'both' :
732730 y = np .zeros (N + 2 , 'd' )
733731 y [0 ] = 0. - extendlength [0 ]
@@ -986,19 +984,23 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
986984 '''
987985 locations = ["left" , "right" , "top" , "bottom" ]
988986 if orientation is not None and location is not None :
989- raise TypeError ('position and orientation are mutually exclusive. Consider ' \
990- 'setting the position to any of %s' % ', ' .join (locations ))
987+ msg = ('position and orientation are mutually exclusive. '
988+ 'Consider setting the position to any of '
989+ '{0}' .format (', ' .join (locations )))
990+ raise TypeError (msg )
991991
992992 # provide a default location
993993 if location is None and orientation is None :
994994 location = 'right'
995995
996- # allow the user to not specify the location by specifying the orientation instead
996+ # allow the user to not specify the location by specifying the
997+ # orientation instead
997998 if location is None :
998999 location = 'right' if orientation == 'vertical' else 'bottom'
9991000
10001001 if location not in locations :
1001- raise ValueError ('Invalid colorbar location. Must be one of %s' % ', ' .join (locations ))
1002+ raise ValueError ('Invalid colorbar location. Must be one '
1003+ 'of %s' % ', ' .join (locations ))
10021004
10031005 default_location_settings = {'left' : {'anchor' : (1.0 , 0.5 ),
10041006 'panchor' : (0.0 , 0.5 ),
@@ -1014,7 +1016,7 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
10141016 'orientation' : 'horizontal' },
10151017 'bottom' : {'anchor' : (0.5 , 1.0 ),
10161018 'panchor' : (0.5 , 0.0 ),
1017- 'pad' : 0.15 , # backwards compat
1019+ 'pad' : 0.15 , # backwards compat
10181020 'orientation' : 'horizontal' },
10191021 }
10201022
@@ -1029,19 +1031,18 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
10291031 parent_anchor = kw .pop ('panchor' , loc_settings ['panchor' ])
10301032 pad = kw .pop ('pad' , loc_settings ['pad' ])
10311033
1032-
10331034 # turn parents into a list if it is not already
10341035 if not isinstance (parents , (list , tuple )):
10351036 parents = [parents ]
10361037
10371038 fig = parents [0 ].get_figure ()
10381039 if not all (fig is ax .get_figure () for ax in parents ):
1039- raise ValueError ('Unable to create a colorbar axes as not all ' + \
1040+ raise ValueError ('Unable to create a colorbar axes as not all '
10401041 'parents share the same figure.' )
10411042
10421043 # take a bounding box around all of the given axes
1043- parents_bbox = mtrans .Bbox .union ([ax .get_position (original = True ).frozen () \
1044- for ax in parents ])
1044+ parents_bbox = mtrans .Bbox .union ([ax .get_position (original = True ).frozen ()
1045+ for ax in parents ])
10451046
10461047 pb = parents_bbox
10471048 if location in ('left' , 'right' ):
@@ -1054,11 +1055,11 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
10541055 if location == 'bottom' :
10551056 pbcb , _ , pb1 = pb .splity (fraction , fraction + pad )
10561057 else :
1057- pb1 , _ , pbcb = pb .splity (1 - fraction - pad , 1 - fraction )
1058+ pb1 , _ , pbcb = pb .splity (1 - fraction - pad , 1 - fraction )
10581059 pbcb = pbcb .shrunk (shrink , 1.0 ).anchored (anchor , pbcb )
10591060
10601061 # define the aspect ratio in terms of y's per x rather than x's per y
1061- aspect = 1.0 / aspect
1062+ aspect = 1.0 / aspect
10621063
10631064 # define a transform which takes us from old axes coordinates to
10641065 # new axes coordinates
0 commit comments