Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Reoder Axes API docs. #9649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 33 additions & 41 deletions doc/api/axes_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,16 @@ Property cycle
Axis / limits
=============

.. For families of methods of the form {get,set}_{x,y}foo, try to list them in
the order set_xfoo, get_xfoo, set_yfoo, get_yfoo

.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:


Axes.get_yaxis
Axes.get_xaxis


Axes.get_yaxis

Axis Limits and direction
-------------------------
Expand All @@ -259,23 +259,22 @@ Axis Limits and direction
:nosignatures:

Axes.invert_xaxis
Axes.invert_yaxis
Axes.xaxis_inverted
Axes.invert_yaxis
Axes.yaxis_inverted

Axes.set_xlim
Axes.get_xlim
Axes.set_ylim
Axes.get_ylim
Axes.get_xlim

Axes.update_datalim
Axes.update_datalim_bounds
Axes.update_datalim_numerix

Axes.set_ybound
Axes.set_xbound
Axes.get_ybound
Axes.get_xbound
Axes.set_ybound
Axes.get_ybound

Axis Labels, title, and legend
------------------------------
Expand All @@ -285,19 +284,17 @@ Axis Labels, title, and legend
:template: autosummary.rst
:nosignatures:

Axes.get_xlabel
Axes.get_ylabel

Axes.set_xlabel
Axes.get_xlabel
Axes.set_ylabel
Axes.get_ylabel

Axes.set_title
Axes.get_title
Axes.legend
Axes.get_legend
Axes.get_legend_handles_labels


Axis scales
-----------

Expand All @@ -308,11 +305,8 @@ Axis scales

Axes.set_xscale
Axes.get_xscale

Axes.get_yscale
Axes.set_yscale


Axes.get_yscale

Autoscaling and margins
-----------------------
Expand All @@ -333,15 +327,14 @@ Autoscaling and margins
Axes.autoscale
Axes.autoscale_view

Axes.get_autoscale_on
Axes.set_autoscale_on
Axes.get_autoscale_on

Axes.get_autoscalex_on
Axes.set_autoscalex_on
Axes.get_autoscalex_on

Axes.get_autoscaley_on
Axes.set_autoscaley_on

Axes.get_autoscaley_on

Aspect ratio
------------
Expand All @@ -352,56 +345,55 @@ Aspect ratio
:nosignatures:

Axes.apply_aspect
Axes.get_aspect
Axes.set_aspect
Axes.get_aspect

Axes.get_adjustable
Axes.set_adjustable

Axes.get_adjustable

Ticks and tick labels
---------------------


.. autosummary::
:toctree: _as_gen
:template: autosummary.rst
:nosignatures:

Axes.xaxis_date
Axes.yaxis_date
Axes.set_xticks
Axes.get_xticks

Axes.set_xticklabels
Axes.get_xticklabels
Axes.get_xmajorticklabels
Axes.get_xminorticklabels
Axes.get_xticklabels

Axes.get_xgridlines
Axes.get_xticklines
Axes.get_xticks

Axes.get_ymajorticklabels
Axes.get_yminorticklabels
Axes.get_yticklabels
Axes.get_yticklines
Axes.get_yticks
Axes.xaxis_date

Axes.minorticks_off
Axes.minorticks_on
Axes.set_yticks
Axes.get_yticks

Axes.set_xticklabels
Axes.set_xticks
Axes.set_yticklabels
Axes.set_yticks
Axes.get_yticklabels
Axes.get_ymajorticklabels
Axes.get_yminorticklabels

Axes.get_xgridlines
Axes.get_ygridlines
Axes.get_yticklines

Axes.yaxis_date

Axes.minorticks_off
Axes.minorticks_on

Axes.ticklabel_format
Axes.tick_params

Axes.locator_params



Units
=====

Expand Down
59 changes: 20 additions & 39 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,9 +1612,7 @@ def axis(self, *v, **kwargs):
return v

def get_legend(self):
"""
Return the legend.Legend instance, or None if no legend is defined
"""
"""Return the `Legend` instance, or None if no legend is defined."""
return self.legend_

def get_images(self):
Expand All @@ -1626,30 +1624,30 @@ def get_lines(self):
return cbook.silent_list('Line2D', self.lines)

def get_xaxis(self):
"""Return the XAxis instance"""
"""Return the XAxis instance."""
return self.xaxis

def get_xgridlines(self):
"""Get the x grid lines as a list of Line2D instances"""
"""Get the x grid lines as a list of `Line2D` instances."""
return cbook.silent_list('Line2D xgridline',
self.xaxis.get_gridlines())

def get_xticklines(self):
"""Get the xtick lines as a list of Line2D instances"""
return cbook.silent_list('Text xtickline',
"""Get the x tick lines as a list of `Line2D` instances."""
return cbook.silent_list('Line2D xtickline',
self.xaxis.get_ticklines())

def get_yaxis(self):
"""Return the YAxis instance"""
"""Return the YAxis instance."""
return self.yaxis

def get_ygridlines(self):
"""Get the y grid lines as a list of Line2D instances"""
"""Get the y grid lines as a list of `Line2D` instances."""
return cbook.silent_list('Line2D ygridline',
self.yaxis.get_gridlines())

def get_yticklines(self):
"""Get the ytick lines as a list of Line2D instances"""
"""Get the y tick lines as a list of `Line2D` instances."""
return cbook.silent_list('Line2D ytickline',
self.yaxis.get_ticklines())

Expand Down Expand Up @@ -2746,27 +2744,16 @@ def set_axis_bgcolor(self, color):
# data limits, ticks, tick labels, and formatting

def invert_xaxis(self):
"Invert the x-axis."
left, right = self.get_xlim()
self.set_xlim(right, left, auto=None)
"""Invert the x-axis."""
self.set_xlim(self.get_xlim()[::-1], auto=None)

def xaxis_inverted(self):
"""Returns *True* if the x-axis is inverted."""
"""Return whether the x-axis is inverted."""
left, right = self.get_xlim()
return right < left

def get_xbound(self):
"""Returns the x-axis numerical bounds

This always returns::

lowerBound < upperBound

Returns
-------
lowerBound, upperBound : float

"""
"""Return the lower and upper x-axis bounds, in increasing order."""
left, right = self.get_xlim()
if left < right:
return left, right
Expand Down Expand Up @@ -3002,7 +2989,7 @@ def set_xticks(self, ticks, minor=False):

def get_xmajorticklabels(self):
"""
Get the xtick major labels
Get the major x tick labels.

Returns
-------
Expand All @@ -3014,7 +3001,7 @@ def get_xmajorticklabels(self):

def get_xminorticklabels(self):
"""
Get the x minor tick labels
Get the minor x tick labels.

Returns
-------
Expand Down Expand Up @@ -3086,22 +3073,16 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs):
return ret

def invert_yaxis(self):
"""
Invert the y-axis.
"""
bottom, top = self.get_ylim()
self.set_ylim(top, bottom, auto=None)
"""Invert the y-axis."""
self.set_ylim(self.get_ylim()[::-1], auto=None)

def yaxis_inverted(self):
"""Returns *True* if the y-axis is inverted."""
"""Return whether the y-axis is inverted."""
bottom, top = self.get_ylim()
return top < bottom

def get_ybound(self):
"""
Return y-axis numerical bounds in the form of
``lowerBound < upperBound``
"""
"""Return the lower and upper y-axis bounds, in increasing order."""
bottom, top = self.get_ylim()
if bottom < top:
return bottom, top
Expand Down Expand Up @@ -3316,7 +3297,7 @@ def set_yticks(self, ticks, minor=False):

def get_ymajorticklabels(self):
"""
Get the major y tick labels
Get the major y tick labels.

Returns
-------
Expand All @@ -3328,7 +3309,7 @@ def get_ymajorticklabels(self):

def get_yminorticklabels(self):
"""
Get the minor y tick labels
Get the minor y tick labels.

Returns
-------
Expand Down