Skip to content

FIX: re-instate ability to have position in axes#21443

Merged
QuLogic merged 1 commit intomatplotlib:mainfrom
jklymak:fix-position-axes
Nov 5, 2021
Merged

FIX: re-instate ability to have position in axes#21443
QuLogic merged 1 commit intomatplotlib:mainfrom
jklymak:fix-position-axes

Conversation

@jklymak
Copy link
Copy Markdown
Member

@jklymak jklymak commented Oct 23, 2021

PR Summary

Closes #21441

import matplotlib.pyplot as plt

fig = plt.figure()

pos1 = [0.1, 0.1, 0.3, 0.8]
pos2 = [0.5, 0.1, 0.4, 0.6]

ax1 = plt.axes(position = pos1)
ax1.plot([0,1], [0, 1], color = 'r', linewidth = 3)

ax2 = plt.axes(position = pos2)
ax2.plot([1, 0], [0, 1], color = 'b', linestyle = '--')

is documented to work, but position is silently ignored. position is just redundant with rect, so go ahead and check for position if rect is None.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@jklymak jklymak added this to the v3.5.1 milestone Oct 29, 2021
@tacaswell
Copy link
Copy Markdown
Member

Do we want to sneak this in for 3.5.0?

@jklymak jklymak marked this pull request as ready for review October 29, 2021 18:39
@jklymak
Copy link
Copy Markdown
Member Author

jklymak commented Oct 29, 2021

I think that would be fine, OTOH, its a bit of an edge case and not urgent, I don't think

@QuLogic QuLogic merged commit 3d7dea5 into matplotlib:main Nov 5, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 5, 2021
jklymak pushed a commit that referenced this pull request Nov 7, 2021
@QuLogic QuLogic modified the milestones: v3.5.1, v3.5.0 Nov 8, 2021
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.

[Bug]: axes(position = [...]) behavior

3 participants