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

ENH: add pad kwarg to set_title #9816

Merged
merged 1 commit into from Nov 20, 2017

Conversation

Projects
None yet
5 participants
@jklymak
Copy link
Contributor

commented Nov 19, 2017

PR Summary

This adds a pad kwarg to axes.set_title().

I was writing some docs on set_title() and was surprised the only way to change the pad was via rcParams. This sets the default to be rcParams, but accepts a float to specify the number of points.

fig, axs = plt.subplots()
tt = axs.set_title('Boo', pad=30.)

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [N/A] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@jklymak jklymak changed the title ENH: add pad kwarg to set_title WIP: ENH: add pad kwarg to set_title Nov 19, 2017

@tacaswell

This comment has been minimized.

Copy link
Member

commented Nov 20, 2017

Can you add a whats_new for this?

# check that title padding puts the title in the right
# place...
fig, ax = plt.subplots()
ax.set_title('aardvark', pad=30.)

This comment has been minimized.

Copy link
@tacaswell

tacaswell Nov 20, 2017

Member

👍 for use of 'aardvark'!

This comment has been minimized.

Copy link
@jklymak

jklymak Nov 20, 2017

Author Contributor

Wish I could claim credit, but I just cut and pasted from elsewhere. I hope its a good inside joke...

This comment has been minimized.

Copy link
@afvincent

afvincent Nov 20, 2017

Contributor

Well at least it is likely to be the first word in English-dictionaries, isn't it ^^? It may actually be(come) a running gag in Matploltib code too: I used it as well in some tests with strings, copy-pasting it from some other existing code section as @jklymak did... (I did not even understand it was a proper word at that time 🐑 )

@tacaswell
Copy link
Member

left a comment

modulo a whats_new entry.

@jklymak jklymak force-pushed the jklymak:add-title-pad branch from 79937d2 to d6fc866 Nov 20, 2017

@jklymak jklymak changed the title WIP: ENH: add pad kwarg to set_title ENH: add pad kwarg to set_title Nov 20, 2017

@jklymak jklymak added this to the v2.2 milestone Nov 20, 2017

@dopplershift dopplershift merged commit 4389baf into matplotlib:master Nov 20, 2017

8 checks passed

ci/circleci: docs-python27 Your tests passed on CircleCI!
Details
ci/circleci: docs-python35 Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 50%)
Details
codecov/project/library 61.7% (target 50%)
Details
codecov/project/tests 98.86% (+<.01%) compared to 7ddc73a
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
lgtm analysis: Python No alert changes
Details

@jklymak jklymak deleted the jklymak:add-title-pad branch Nov 20, 2017

@jklymak jklymak restored the jklymak:add-title-pad branch Nov 22, 2017

@jklymak jklymak deleted the jklymak:add-title-pad branch Nov 22, 2017

@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.