99rcParams = matplotlib .rcParams
1010
1111from matplotlib import artist as martist
12- from matplotlib import affine as maffine
1312from matplotlib import agg
1413from matplotlib import axis as maxis
1514from matplotlib import cbook
2928from matplotlib import table as mtable
3029from matplotlib import text as mtext
3130from matplotlib import ticker as mticker
31+ from matplotlib import transforms as mtransforms
3232
3333iterable = cbook .iterable
3434is_string_like = cbook .is_string_like
@@ -481,7 +481,7 @@ def __init__(self, fig, rect,
481481
482482 """
483483 martist .Artist .__init__ (self )
484- self ._position = maffine .Bbox .from_lbwh (* rect )
484+ self ._position = mtransforms .Bbox .from_lbwh (* rect )
485485 self ._originalPosition = copy .deepcopy (self ._position )
486486 self .set_axes (self )
487487 self .set_aspect ('auto' )
@@ -612,7 +612,7 @@ def set_figure(self, fig):
612612 """
613613 martist .Artist .set_figure (self , fig )
614614
615- self .bbox = maffine .TransformedBbox (self ._position , fig .transFigure )
615+ self .bbox = mtransforms .TransformedBbox (self ._position , fig .transFigure )
616616 #these will be updated later as data is added
617617 self ._set_lim_and_transforms ()
618618
@@ -631,7 +631,7 @@ def _set_lim_and_transforms(self):
631631 set the dataLim and viewLim BBox attributes and the
632632 transData and transAxes Transformation attributes
633633 """
634- Bbox = maffine .Bbox
634+ Bbox = mtransforms .Bbox
635635 self .viewLim = Bbox .unit ()
636636
637637 if self ._sharex is not None :
@@ -647,20 +647,11 @@ def _set_lim_and_transforms(self):
647647
648648 self .dataLim = Bbox .unit ()
649649
650- self .transAxes = maffine .BboxTransform (
650+ self .transAxes = mtransforms .BboxTransform (
651651 Bbox .unit (), self .bbox )
652652
653- localTransData = maffine .BboxTransform (
653+ self . transData = mtransforms .BboxTransform (
654654 self .viewLim , self .bbox )
655- if self ._sharex :
656- transDataX = self ._sharex .transData
657- else :
658- transDataX = localTransData
659- if self ._sharey :
660- transDataY = self ._sharey .transData
661- else :
662- transDataY = localTransData
663- self .transData = localTransData # maffine.blend_xy_sep_transform(transDataX, transDataY)
664655
665656
666657 def get_position (self , original = False ):
@@ -1538,7 +1529,7 @@ def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs):
15381529# and min(xmin, xmax)<=0):
15391530# raise ValueError('Cannot set nonpositive limits with log transform')
15401531
1541- xmin , xmax = maffine .nonsingular (xmin , xmax , increasing = False )
1532+ xmin , xmax = mtransforms .nonsingular (xmin , xmax , increasing = False )
15421533
15431534 self .viewLim .intervalx = (xmin , xmax )
15441535 if emit :
@@ -1670,7 +1661,7 @@ def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs):
16701661# and min(ymin, ymax)<=0):
16711662# raise ValueError('Cannot set nonpositive limits with log transform')
16721663
1673- ymin , ymax = maffine .nonsingular (ymin , ymax , increasing = False )
1664+ ymin , ymax = mtransforms .nonsingular (ymin , ymax , increasing = False )
16741665 self .viewLim .intervaly = (ymin , ymax )
16751666 if emit :
16761667 self .callbacks .process ('ylim_changed' , self )
@@ -2167,7 +2158,7 @@ def annotate(self, *args, **kwargs):
21672158 %(Annotation)s
21682159 """
21692160 a = mtext .Annotation (* args , ** kwargs )
2170- a .set_transform (maffine .Affine2D ())
2161+ a .set_transform (mtransforms .Affine2D ())
21712162 self ._set_artist_props (a )
21722163 if kwargs .has_key ('clip_on' ): a .set_clip_box (self .bbox )
21732164 self .texts .append (a )
@@ -2206,7 +2197,7 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
22062197 %(Line2D)s
22072198 """
22082199
2209- trans = maffine .blend_xy_sep_transform (self .transAxes , self .transData )
2200+ trans = mtransforms .blend_xy_sep_transform (self .transAxes , self .transData )
22102201 l , = self .plot ([xmin ,xmax ], [y ,y ], transform = trans , scalex = False , ** kwargs )
22112202 return l
22122203
@@ -2242,7 +2233,7 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
22422233 %(Line2D)s
22432234 """
22442235
2245- trans = maffine .blend_xy_sep_transform ( self .transData , self .transAxes )
2236+ trans = mtransforms .blend_xy_sep_transform ( self .transData , self .transAxes )
22462237 l , = self .plot ([x ,x ], [ymin ,ymax ] , transform = trans , scaley = False , ** kwargs )
22472238 return l
22482239
@@ -2281,7 +2272,7 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
22812272 %(Polygon)s
22822273 """
22832274 # convert y axis units
2284- trans = maffine .blend_xy_sep_transform ( self .transAxes , self .transData )
2275+ trans = mtransforms .blend_xy_sep_transform ( self .transAxes , self .transData )
22852276 verts = (xmin , ymin ), (xmin , ymax ), (xmax , ymax ), (xmax , ymin )
22862277 p = mpatches .Polygon (verts , ** kwargs )
22872278 p .set_transform (trans )
@@ -2321,7 +2312,7 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
23212312 %(Polygon)s
23222313 """
23232314 # convert x axis units
2324- trans = maffine .blend_xy_sep_transform (self .transData , self .transAxes )
2315+ trans = mtransforms .blend_xy_sep_transform (self .transData , self .transAxes )
23252316 verts = [(xmin , ymin ), (xmin , ymax ), (xmax , ymax ), (xmax , ymin )]
23262317 p = mpatches .Polygon (verts , ** kwargs )
23272318 p .set_transform (trans )
@@ -4104,7 +4095,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
41044095 offsets = zip (x ,y ),
41054096 transOffset = self .transData ,
41064097 )
4107- collection .set_transform (maffine .Affine2D ())
4098+ collection .set_transform (mtransforms .Affine2D ())
41084099 collection .set_alpha (alpha )
41094100 collection .update (kwargs )
41104101
0 commit comments