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

Skip to content

Add discouraged admonitions #23632

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 1 commit into from
Aug 16, 2022
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
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
**kwargs):
"""
Plot coercing the axis to treat floats as dates.
[*Discouraged*] Plot coercing the axis to treat floats as dates.

.. admonition:: Discouraged

Expand Down
16 changes: 10 additions & 6 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2128,19 +2128,23 @@ def get_lines(self):

def get_xaxis(self):
"""
Return the XAxis instance.
[*Discouraged*] Return the XAxis instance.

The use of this function is discouraged. You should instead directly
access the attribute ``ax.xaxis``.
.. admonition:: Discouraged

The use of this function is discouraged. You should instead
directly access the attribute ``ax.xaxis``.
"""
return self.xaxis

def get_yaxis(self):
"""
Return the YAxis instance.
[*Discouraged*] Return the YAxis instance.

.. admonition:: Discouraged

The use of this function is discouraged. You should instead directly
access the attribute ``ax.yaxis``.
The use of this function is discouraged. You should instead
directly access the attribute ``ax.yaxis``.
"""
return self.yaxis

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ def _format_with_dict(tickd, x, pos):

def set_ticklabels(self, ticklabels, *, minor=False, **kwargs):
r"""
Set the text values of the tick labels.
[*Discouraged*] Set the text values of the tick labels.

.. admonition:: Discouraged

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def get_ticks(self, minor=False):
def set_ticklabels(self, ticklabels, update_ticks=True, *, minor=False,
**kwargs):
"""
Set tick labels.
[*Discouraged*] Set tick labels.

.. admonition:: Discouraged

Expand Down
11 changes: 7 additions & 4 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ def clear(self, keep_observers=False):
# synonym for `clear`.
def clf(self, keep_observers=False):
"""
Alias for the `clear()` method.
[*Discouraged*] Alias for the `clear()` method.

.. admonition:: Discouraged

Expand Down Expand Up @@ -2689,7 +2689,8 @@ def get_tight_layout(self):
pending=True)
def set_tight_layout(self, tight):
"""
Set whether and how `.tight_layout` is called when drawing.
[*Discouraged*] Set whether and how `.tight_layout` is called when
drawing.

.. admonition:: Discouraged

Expand Down Expand Up @@ -2722,8 +2723,10 @@ def get_constrained_layout(self):
pending=True)
def set_constrained_layout(self, constrained):
"""
Set whether ``constrained_layout`` is used upon drawing. If None,
:rc:`figure.constrained_layout.use` value will be used.
[*Discouraged*] Set whether ``constrained_layout`` is used upon
drawing.

If None, :rc:`figure.constrained_layout.use` value will be used.

When providing a dict containing the keys ``w_pad``, ``h_pad``
the default ``constrained_layout`` paddings will be
Expand Down