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