diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index e5f189c94b62..1697e91e0862 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -3011,9 +3011,9 @@ def get_xticklabels(self, minor=False, which=None): Parameters ---------- - minor : bool + minor : bool, optional If True return the minor ticklabels, - else return the major ticklabels + else return the major ticklabels. which : None, ('minor', 'major', 'both') Overrides `minor`. @@ -3038,6 +3038,19 @@ def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs): labels : list of str list of string labels + fontdict : dict, optional + A dictionary controlling the appearance of the ticklabels, + the default `fontdict` is: + + {'fontsize': rcParams['axes.titlesize'], + 'fontweight' : rcParams['axes.titleweight'], + 'verticalalignment': 'baseline', + 'horizontalalignment': loc} + + minor : bool, optional + If True select the minor ticklabels, + else select the minor ticklabels + Returns ------- A list of `~matplotlib.text.Text` instances @@ -3335,6 +3348,19 @@ def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs): labels : list of str list of string labels + fontdict : dict, optional + A dictionary controlling the appearance of the ticklabels, + the default `fontdict` is:: + + {'fontsize': rcParams['axes.titlesize'], + 'fontweight' : rcParams['axes.titleweight'], + 'verticalalignment': 'baseline', + 'horizontalalignment': loc} + + minor : bool, optional + If True select the minor ticklabels, + else select the minor ticklabels + Returns ------- A list of `~matplotlib.text.Text` instances. diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index ac1eda6716ca..3067acea87e2 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -860,20 +860,35 @@ def fixlist(args): key = fixlist(args), fixitems(six.iteritems(kwargs)) return key - @docstring.dedent_interpd def add_axes(self, *args, **kwargs): """ Add an axes at position *rect* [*left*, *bottom*, *width*, *height*] where all quantities are in fractions of figure - width and height. kwargs are legal - :class:`~matplotlib.axes.Axes` kwargs plus *projection* which - sets the projection type of the axes. (For backward - compatibility, ``polar=True`` may also be provided, which is - equivalent to ``projection='polar'``). Valid values for - *projection* are: %(projection_names)s. Some of these - projections support additional kwargs, which may be provided - to :meth:`add_axes`. Typical usage:: + width and height. + + Parameters + ---------- + rect : sequence of float + A 4-length sequence of [left, bottom, width, height] quantities. + + projection : + ['aitoff' | 'hammer' | 'lambert' | 'mollweide' | \ +'polar' | 'rectilinear'], optional + The projection type of the axes. + + polar : boolean, optional + If True, equivalent to projection='polar'. + This method also takes the keyword arguments for + :class:`~matplotlib.axes.Axes`. + + Returns + ------ + axes : Axes + The added axes. + + Examples + -------- rect = l,b,w,h fig.add_axes(rect) fig.add_axes(rect, frameon=False, facecolor='g') @@ -903,10 +918,6 @@ def add_axes(self, *args, **kwargs): In all cases, the :class:`~matplotlib.axes.Axes` instance will be returned. - - In addition to *projection*, the following kwargs are supported: - - %(Axes)s """ if not len(args): return @@ -949,11 +960,41 @@ def add_axes(self, *args, **kwargs): a.stale_callback = _stale_figure_callback return a - @docstring.dedent_interpd def add_subplot(self, *args, **kwargs): """ - Add a subplot. Examples:: + Add a subplot. + + Parameters + ---------- + *args + Either a 3-digit integer or three separate integers + describing the position of the subplot. If the three + integers are I, J, and K, the subplot is the Ith plot on a + grid with J rows and K columns. + + projection : ['aitoff' | 'hammer' | 'lambert' | \ +'mollweide', 'polar' | 'rectilinear'], optional + The projection type of the axes. + + polar : boolean, optional + If True, equivalent to projection='polar'. + This method also takes the keyword arguments for + :class:`~matplotlib.axes.Axes`. + + Returns + ------- + axes : Axes + The axes of the subplot. + + Notes + ----- + If the figure already has a subplot with key (*args*, + *kwargs*) then it will simply make that subplot current and + return it. + + Examples + -------- fig.add_subplot(111) # equivalent but more general @@ -968,27 +1009,9 @@ def add_subplot(self, *args, **kwargs): # add Subplot instance sub fig.add_subplot(sub) - *kwargs* are legal :class:`~matplotlib.axes.Axes` kwargs plus - *projection*, which chooses a projection type for the axes. - (For backward compatibility, *polar=True* may also be - provided, which is equivalent to *projection='polar'*). Valid - values for *projection* are: %(projection_names)s. Some of - these projections - support additional *kwargs*, which may be provided to - :meth:`add_axes`. - - The :class:`~matplotlib.axes.Axes` instance will be returned. - - If the figure already has a subplot with key (*args*, - *kwargs*) then it will simply make that subplot current and - return it. - - .. seealso:: :meth:`~matplotlib.pyplot.subplot` for an - explanation of the args. - - The following kwargs are supported: - - %(Axes)s + See Also + -------- + matplotlib.pyplot.subplot : for an explanation of the args. """ if not len(args): return pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy