Skip to content
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

DOC: Clarify y parameter in Axes.set_title #22064

Merged
merged 1 commit into from
Dec 29, 2021

Conversation

StefRe
Copy link
Contributor

@StefRe StefRe commented Dec 29, 2021

PR Summary

Autopositioning only works if rcParams["axes.titley"] is None in addition
to y being None in the function call. If rcParams["axes.titley"] is set
to a float, there's no way to enforce autopositioning by function call
parameters (passing y=None has no effect in this case).

Link to current doc: https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.set_title.html

Example:

import matplotlib.pyplot as plt

plt.rcParams["axes.titley"] = 1.0
fig, ax = plt.subplots()
ax.xaxis.tick_top()
ax.set_title('Title', y=None)  # trying to override rcParams["axes.titley"] here

grafik

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

Autopositioning only works if rcParams["axes.titley"] is None in addition
to y being None in the function call. If rcParams["axes.titley"] is set
to a float, there's no way to enforce autopositioning by function call
parameters (passing y=None has no effect in this case).
@StefRe StefRe changed the title DOC: Clarify y paramter in Axes.set_title DOC: Clarify y parameter in Axes.set_title Dec 29, 2021
@dstansby dstansby added this to the v3.5.2 milestone Dec 29, 2021
@timhoffm timhoffm merged commit 88ea09b into matplotlib:main Dec 29, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Dec 29, 2021
timhoffm added a commit that referenced this pull request Dec 30, 2021
…064-on-v3.5.x

Backport PR #22064 on branch v3.5.x (DOC: Clarify y parameter in Axes.set_title)
@StefRe StefRe deleted the doc/set_title branch December 30, 2021 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants