@@ -682,23 +682,23 @@ def get_xaxis_transform(self, which='grid'):
682
682
683
683
def get_xaxis_text1_transform (self , pad_points ):
684
684
"""
685
- Get the transformation used for drawing x-axis labels, which
686
- will add the given amount of padding (in points) between the
687
- axes and the label. The x-direction is in data coordinates
688
- and the y-direction is in axis coordinates. Returns a
689
- 3-tuple of the form::
690
-
691
- (transform, valign, halign)
692
-
693
- where *valign* and *halign* are requested alignments for the
694
- text.
695
-
696
- .. note::
685
+ Returns
686
+ -------
687
+ transform : Transform
688
+ The transform used for drawing x-axis labels, which will add
689
+ *pad_points* of padding (in points) between the axes and the label.
690
+ The x-direction is in data coordinates and the y-direction is in
691
+ axis corrdinates
692
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
693
+ The text vertical alignment.
694
+ halign : {'center', 'left', 'right'}
695
+ The text horizontal alignment.
697
696
698
- This transformation is primarily used by the
699
- `~matplotlib.axis.Axis` class, and is meant to be
700
- overridden by new kinds of projections that may need to
701
- place axis elements in different locations.
697
+ Notes
698
+ -----
699
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
700
+ class, and is meant to be overridden by new kinds of projections that
701
+ may need to place axis elements in different locations.
702
702
"""
703
703
labels_align = rcParams ["xtick.alignment" ]
704
704
return (self .get_xaxis_transform (which = 'tick1' ) +
@@ -708,23 +708,23 @@ def get_xaxis_text1_transform(self, pad_points):
708
708
709
709
def get_xaxis_text2_transform (self , pad_points ):
710
710
"""
711
- Get the transformation used for drawing the secondary x-axis
712
- labels, which will add the given amount of padding (in points)
713
- between the axes and the label. The x-direction is in data
714
- coordinates and the y-direction is in axis coordinates.
715
- Returns a 3-tuple of the form::
716
-
717
- (transform, valign, halign)
718
-
719
- where *valign* and *halign* are requested alignments for the
720
- text.
721
-
722
- .. note::
711
+ Returns
712
+ -------
713
+ transform : Transform
714
+ The transform used for drawing secondary x-axis labels, which will
715
+ add *pad_points* of padding (in points) between the axes and the
716
+ label. The x-direction is in data coordinates and the y-direction
717
+ is in axis corrdinates
718
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
719
+ The text vertical alignment.
720
+ halign : {'center', 'left', 'right'}
721
+ The text horizontal alignment.
723
722
724
- This transformation is primarily used by the
725
- `~matplotlib.axis.Axis` class, and is meant to be
726
- overridden by new kinds of projections that may need to
727
- place axis elements in different locations.
723
+ Notes
724
+ -----
725
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
726
+ class, and is meant to be overridden by new kinds of projections that
727
+ may need to place axis elements in different locations.
728
728
"""
729
729
labels_align = rcParams ["xtick.alignment" ]
730
730
return (self .get_xaxis_transform (which = 'tick2' ) +
@@ -758,23 +758,23 @@ def get_yaxis_transform(self, which='grid'):
758
758
759
759
def get_yaxis_text1_transform (self , pad_points ):
760
760
"""
761
- Get the transformation used for drawing y-axis labels, which
762
- will add the given amount of padding (in points) between the
763
- axes and the label. The x-direction is in axis coordinates
764
- and the y-direction is in data coordinates. Returns a 3-tuple
765
- of the form::
766
-
767
- (transform, valign, halign)
768
-
769
- where *valign* and *halign* are requested alignments for the
770
- text.
771
-
772
- .. note::
761
+ Returns
762
+ -------
763
+ transform : Transform
764
+ The transform used for drawing y-axis labels, which will add
765
+ *pad_points* of padding (in points) between the axes and the label.
766
+ The x-direction is in axis coordinates and the y-direction is in
767
+ data corrdinates
768
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
769
+ The text vertical alignment.
770
+ halign : {'center', 'left', 'right'}
771
+ The text horizontal alignment.
773
772
774
- This transformation is primarily used by the
775
- `~matplotlib.axis.Axis` class, and is meant to be
776
- overridden by new kinds of projections that may need to
777
- place axis elements in different locations.
773
+ Notes
774
+ -----
775
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
776
+ class, and is meant to be overridden by new kinds of projections that
777
+ may need to place axis elements in different locations.
778
778
"""
779
779
labels_align = rcParams ["ytick.alignment" ]
780
780
return (self .get_yaxis_transform (which = 'tick1' ) +
@@ -784,23 +784,23 @@ def get_yaxis_text1_transform(self, pad_points):
784
784
785
785
def get_yaxis_text2_transform (self , pad_points ):
786
786
"""
787
- Get the transformation used for drawing the secondary y-axis
788
- labels, which will add the given amount of padding (in points)
789
- between the axes and the label. The x-direction is in axis
790
- coordinates and the y-direction is in data coordinates.
791
- Returns a 3-tuple of the form::
792
-
793
- (transform, valign, halign)
794
-
795
- where *valign* and *halign* are requested alignments for the
796
- text.
797
-
798
- .. note::
787
+ Returns
788
+ -------
789
+ transform : Transform
790
+ The transform used for drawing secondart y-axis labels, which will
791
+ add *pad_points* of padding (in points) between the axes and the
792
+ label. The x-direction is in axis coordinates and the y-direction
793
+ is in data corrdinates
794
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
795
+ The text vertical alignment.
796
+ halign : {'center', 'left', 'right'}
797
+ The text horizontal alignment.
799
798
800
- This transformation is primarily used by the
801
- `~matplotlib.axis.Axis` class, and is meant to be
802
- overridden by new kinds of projections that may need to
803
- place axis elements in different locations.
799
+ Notes
800
+ -----
801
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
802
+ class, and is meant to be overridden by new kinds of projections that
803
+ may need to place axis elements in different locations.
804
804
"""
805
805
labels_align = rcParams ["ytick.alignment" ]
806
806
return (self .get_yaxis_transform (which = 'tick2' ) +
@@ -923,33 +923,35 @@ def _set_artist_props(self, a):
923
923
924
924
def _gen_axes_patch (self ):
925
925
"""
926
- Returns the patch used to draw the background of the axes. It
927
- is also used as the clipping path for any data elements on the
928
- axes.
929
-
930
- In the standard axes, this is a rectangle, but in other
931
- projections it may not be.
932
-
933
- .. note::
926
+ Returns
927
+ -------
928
+ Patch
929
+ The patch used to draw the background of the axes. It is also used
930
+ as the clipping path for any data elements on the axes.
934
931
935
- Intended to be overridden by new projection types.
932
+ In the standard axes, this is a rectangle, but in other projections
933
+ it may not be.
936
934
935
+ Notes
936
+ -----
937
+ Intended to be overridden by new projection types.
937
938
"""
938
939
return mpatches .Rectangle ((0.0 , 0.0 ), 1.0 , 1.0 )
939
940
940
941
def _gen_axes_spines (self , locations = None , offset = 0.0 , units = 'inches' ):
941
942
"""
942
- Returns a dict whose keys are spine names and values are
943
- Line2D or Patch instances. Each element is used to draw a
944
- spine of the axes.
945
-
946
- In the standard axes, this is a single line segment, but in
947
- other projections it may not be.
943
+ Returns
944
+ -------
945
+ dict
946
+ Mapping of spine names to `Line2D` or `Patch` instances that are
947
+ used to draw axes spines.
948
948
949
- .. note::
950
-
951
- Intended to be overridden by new projection types.
949
+ In the standard axes, spines are single line segments, but in other
950
+ projections they may not be.
952
951
952
+ Notes
953
+ -----
954
+ Intended to be overridden by new projection types.
953
955
"""
954
956
return OrderedDict ((side , mspines .Spine .linear_spine (self , side ))
955
957
for side in ['left' , 'right' , 'bottom' , 'top' ])
@@ -1410,10 +1412,11 @@ def set_anchor(self, anchor, share=False):
1410
1412
1411
1413
def get_data_ratio (self ):
1412
1414
"""
1413
- Returns the aspect ratio of the raw data.
1415
+ Return the aspect ratio of the raw data.
1414
1416
1415
- This method is intended to be overridden by new projection
1416
- types.
1417
+ Notes
1418
+ -----
1419
+ This method is intended to be overridden by new projection types.
1417
1420
"""
1418
1421
xmin , xmax = self .get_xbound ()
1419
1422
ymin , ymax = self .get_ybound ()
@@ -1425,8 +1428,11 @@ def get_data_ratio(self):
1425
1428
1426
1429
def get_data_ratio_log (self ):
1427
1430
"""
1428
- Returns the aspect ratio of the raw data in log scale.
1429
- Will be used when both axis scales are in log.
1431
+ Return the aspect ratio of the raw data in log scale.
1432
+
1433
+ Notes
1434
+ -----
1435
+ Will be used when both axis are in log scale.
1430
1436
"""
1431
1437
xmin , xmax = self .get_xbound ()
1432
1438
ymin , ymax = self .get_ybound ()
@@ -4244,7 +4250,7 @@ def contains(self, mouseevent):
4244
4250
4245
4251
def contains_point (self , point ):
4246
4252
"""
4247
- Returns whether *point* (pair of pixel coordinates) is inside the axes
4253
+ Return whether *point* (pair of pixel coordinates) is inside the axes
4248
4254
patch.
4249
4255
"""
4250
4256
return self .patch .contains_point (point , radius = 1.0 )
0 commit comments