@@ -595,13 +595,13 @@ def get_xaxis_transform(self):
595595 """
596596 return self ._xaxis_transform
597597
598- def get_xaxis_text1_transform (self , pad_pixels ):
598+ def get_xaxis_text1_transform (self , pad_points ):
599599 """
600600 Get the transformation used for drawing x-axis labels, which
601- will add the given number of pad_pixels between the axes and
602- the label. The x-direction is in data coordinates and the
603- y-direction is in axis coordinates. Returns a 3-tuple of the
604- form:
601+ will add the given amount of padding (in points) between the
602+ axes and the label. The x-direction is in data coordinates
603+ and the y-direction is in axis coordinates. Returns a 3-tuple
604+ of the form:
605605
606606 (transform, valign, halign)
607607
@@ -612,14 +612,15 @@ def get_xaxis_text1_transform(self, pad_pixels):
612612 need to place axis elements in different locations.
613613 """
614614 return (self ._xaxis_transform +
615- mtransforms .Affine2D ().translate (0 , - 1 * pad_pixels ),
615+ mtransforms .ScaledTranslation (0 , - 1 * pad_points / 72.0 ,
616+ self .figure .dpi_scale_trans ),
616617 "top" , "center" )
617618
618- def get_xaxis_text2_transform (self , pad_pixels ):
619+ def get_xaxis_text2_transform (self , pad_points ):
619620 """
620621 Get the transformation used for drawing the secondary x-axis
621- labels, which will add the given number of pad_pixels between
622- the axes and the label. The x-direction is in data
622+ labels, which will add the given amount of padding (in points)
623+ between the axes and the label. The x-direction is in data
623624 coordinates and the y-direction is in axis coordinates.
624625 Returns a 3-tuple of the form:
625626
@@ -632,7 +633,8 @@ def get_xaxis_text2_transform(self, pad_pixels):
632633 need to place axis elements in different locations.
633634 """
634635 return (self ._xaxis_transform +
635- mtransforms .Affine2D ().translate (0 , pad_pixels ),
636+ mtransforms .ScaledTranslation (0 , pad_points / 72.0 ,
637+ self .figure .dpi_scale_trans ),
636638 "bottom" , "center" )
637639
638640 def get_yaxis_transform (self ):
@@ -647,13 +649,13 @@ def get_yaxis_transform(self):
647649 """
648650 return self ._yaxis_transform
649651
650- def get_yaxis_text1_transform (self , pad_pixels ):
652+ def get_yaxis_text1_transform (self , pad_points ):
651653 """
652654 Get the transformation used for drawing y-axis labels, which
653- will add the given number of pad_pixels between the axes and
654- the label. The x-direction is in axis coordinates and the
655- y-direction is in data coordinates. Returns a 3-tuple of the
656- form:
655+ will add the given amount of padding (in points) between the
656+ axes and the label. The x-direction is in axis coordinates
657+ and the y-direction is in data coordinates. Returns a 3-tuple
658+ of the form:
657659
658660 (transform, valign, halign)
659661
@@ -664,14 +666,15 @@ def get_yaxis_text1_transform(self, pad_pixels):
664666 need to place axis elements in different locations.
665667 """
666668 return (self ._yaxis_transform +
667- mtransforms .Affine2D ().translate (- 1 * pad_pixels , 0 ),
669+ mtransforms .ScaledTranslation (- 1 * pad_points / 72.0 , 0 ,
670+ self .figure .dpi_scale_trans ),
668671 "center" , "right" )
669672
670- def get_yaxis_text2_transform (self , pad_pixels ):
673+ def get_yaxis_text2_transform (self , pad_points ):
671674 """
672675 Get the transformation used for drawing the secondary y-axis
673- labels, which will add the given number of pad_pixels between
674- the axes and the label. The x-direction is in axis
676+ labels, which will add the given amount of padding (in points)
677+ between the axes and the label. The x-direction is in axis
675678 coordinates and the y-direction is in data coordinates.
676679 Returns a 3-tuple of the form:
677680
@@ -684,7 +687,8 @@ def get_yaxis_text2_transform(self, pad_pixels):
684687 need to place axis elements in different locations.
685688 """
686689 return (self ._yaxis_transform +
687- mtransforms .Affine2D ().translate (pad_pixels , 0 ),
690+ mtransforms .ScaledTranslation (- 1 * pad_points / 72.0 , 0 ,
691+ self .figure .dpi_scale_trans ),
688692 "center" , "left" )
689693
690694 def _update_transScale (self ):
@@ -4287,7 +4291,6 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
42874291 if sym is not None :
42884292 if symstyle == 0 :
42894293 collection = mcoll .RegularPolyCollection (
4290- self .figure .dpi ,
42914294 numsides , rotation , scales ,
42924295 facecolors = colors ,
42934296 edgecolors = edgecolors ,
@@ -4297,7 +4300,6 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
42974300 )
42984301 elif symstyle == 1 :
42994302 collection = mcoll .StarPolygonCollection (
4300- self .figure .dpi ,
43014303 numsides , rotation , scales ,
43024304 facecolors = colors ,
43034305 edgecolors = edgecolors ,
@@ -4307,7 +4309,6 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
43074309 )
43084310 elif symstyle == 2 :
43094311 collection = mcoll .AsteriskPolygonCollection (
4310- self .figure .dpi ,
43114312 numsides , rotation , scales ,
43124313 facecolors = colors ,
43134314 edgecolors = edgecolors ,
@@ -4316,6 +4317,7 @@ def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
43164317 transOffset = self .transData ,
43174318 )
43184319 else :
4320+ # MGDTODO: This has dpi problems
43194321 # rescale verts
43204322 rescale = npy .sqrt (max (verts [:,0 ]** 2 + verts [:,1 ]** 2 ))
43214323 verts /= rescale
0 commit comments