Skip to content

Add ability to scale BBox with just x or y values #21326

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
Oct 21, 2021

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Oct 9, 2021

PR Summary

This is useful in Axes3D, when we are autoscaling with x and y values that are not always the same shape. As an example, see the contour code in #21310. Fixes #21310, and an alternative (with a nicer fix in my opinion) to #21312

If someone leaves a positive comment on this, I'll add a what's new entry and tests.

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).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@anntzer
Copy link
Contributor

anntzer commented Oct 10, 2021

I don't really like either APIs, but I agree this one makes more sense (saving an unnecessary meshgrid).

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not particularly elegant, but I do think we want the ability to autoscale from separate X, Y vectors. And we don't want to have to meshgrid X, Y only for the purpose of autoscaling.

So it seems to be the right solution.

@dstansby dstansby added this to the v3.5.1 milestone Oct 17, 2021
@dstansby
Copy link
Member Author

Comments address and a test added (that fails before this PR). I've tagged as 3.5.1 as this is a bugfix.

@dstansby dstansby marked this pull request as ready for review October 17, 2021 10:27
@tacaswell
Copy link
Member

This PR is affected by a re-writing of our history to remove a large number of accidentally committed files see discourse for details.

To recover this PR it will need be rebased onto the new default branch (main). There are several ways to accomplish this, but we recommend (assuming that you call the matplotlib/matplotlib remote "upstream"

git remote update
git checkout main
git merge --ff-only upstream/main
git checkout YOUR_BRANCH
git rebase --onto=main upstream/old_master
# git rebase -i main # if you prefer
git push --force-with-lease   # assuming you are tracking your branch

If you do not feel comfortable doing this or need any help please reach out to any of the Matplotlib developers. We can either help you with the process or do it for you.

Thank you for your contributions to Matplotlib and sorry for the inconvenience.

@anntzer anntzer merged commit 9716ee9 into matplotlib:main Oct 21, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Oct 21, 2021
@dstansby dstansby deleted the bbox-scale branch October 21, 2021 14:42
timhoffm added a commit that referenced this pull request Oct 21, 2021
…326-on-v3.5.x

Backport PR #21326 on branch v3.5.x (Add ability to scale BBox with just x or y values)
@QuLogic QuLogic modified the milestones: v3.5.1, v3.5.0 Oct 21, 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]: contour on 3d plot fails if x and y are 1d and different lengths
5 participants