GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix mplot3d projection by eric-wieser · Pull Request #16472 · matplotlib/matplotlib

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Feb 11, 2020

Copy link
Copy Markdown
Contributor

Redo of gh-8896, which was force-pushed out of the history.

There is now only a single commit with image updates.

It is likely that the images are wrong, because my machine does not produce CI-compatible images.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
eric-wieser and others added 4 commits February 11, 2020 16:17
@eric-wieser
BUG: Fix the aspect ratio of 3d plots
4479a0f
Fixes matplotlibgh-8894, by always using a "position" that maintains a uniform coordinate system.

Test added - when viewed from above, the plot should be square not rhombic.
@eric-wieser
ENH: Set the default plotbox aspect to match how renders looked previ…
c3e7c48
…ously

This sets it to have a 4:3 aspect ratio, which matches what would result from a typical figure layout
@eric-wieser
TST: Change tests to use default styles
d594ca1
As requested in review feedback - since all the images changed, may as well
restyle them.

Note that this restyling caused a test to become platform-dependent on the
anti-aliasing on the edges of a narrow line - presumably due to the resolution
decrease making the line narrower - so a non-zero `tol` value was added.
@anntzer @eric-wieser
TST: Use functools.partial to shorten test decorators
61cec6e
@eric-wieser
eric-wieser requested a review from anntzer February 11, 2020 16:27
@anntzer @eric-wieser
Add updated baseline images for the previous commits
ce08435
@eric-wieser
eric-wieser force-pushed the fix-mplot3d-projection branch from 8ffc57b to ce08435 Compare February 11, 2020 16:51
@jklymak jklymak added this to the v3.3.0 milestone Feb 11, 2020
@jklymak jklymak added the topic: mplot3d label Feb 11, 2020
jklymak
jklymak approved these changes Feb 11, 2020
View reviewed changes

@jklymak jklymak left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Seems to be passing!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
anntzer
anntzer approved these changes Feb 11, 2020
View reviewed changes
@anntzer

anntzer commented Feb 11, 2020

Copy link
Copy Markdown
Contributor

I'll wait for travis to pass too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anntzer

anntzer commented Feb 11, 2020

Copy link
Copy Markdown
Contributor

travis failure is spurious.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anntzer
anntzer merged commit 4746a8d into matplotlib:master Feb 11, 2020
@ImportanceOfBeingErnest ImportanceOfBeingErnest mentioned this pull request Feb 21, 2020
Jupyter "inline" backend seems to misinterpret "figsize" with Axes3D #16463
Closed
@eric-wieser eric-wieser mentioned this pull request Mar 4, 2020
[MRG] Optimize 3D display (continued) #11577
Closed
8 of 10 tasks
@ImportanceOfBeingErnest ImportanceOfBeingErnest mentioned this pull request Apr 18, 2020
set_aspect for 3D plots #17172
Closed
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request May 27, 2020
@tacaswell
ENH/FIX: make "auto" aspect with Axes3D match Axes better
5451b25
To make bbox_inches='tight' work correctly, we cache the positions of
all of the axes, change their aspect to 'auto', adjust the transforms
on the figure, render the output, and then restore the previous
setting of aspect to each of the figures.  This prevent the Axes from
trying to adjust their size on draw. This matters because for the
render that is emitted the figure transforms are out of sync with the
figure size.

As part of cleaning fixing the rendering of Axes3D in matplotlib#8896 / matplotlib#16472
we started to use apply_aspect to re-size the area the Axes3D takes up
to maintain a fixed ratio between the axes when the aspect is "auto".
However this conflicts with the expectation in tight_bbox.adjust_bbox
as it assumes setting the aspect to "auto" will prevent any axes
resizing.

This commit addresses this by:
 - exiting the Axes3D.apply_aspect early if aspect is auto
 - adding a new aspect mode 'auto_pb' which is the default
   for Axes3D which maintains the current master branch behavior
   of maintaining a fixed ratio between the sizes of the x, y z axis
   independent of the data limits.
 - re implement several functions on Axes3D to make sure they handle
   sharez correctly.

closes matplotlib#16463.
@tacaswell tacaswell mentioned this pull request May 27, 2020
FIX: add set_box_aspect, improve tight bounding box for Axes3D + fix bbox_inches support with fixed box_aspect #17515
Merged
1 of 6 tasks
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request May 30, 2020
@tacaswell
FIX: support bbox_inches='tight' for box_aspect Axes
390a57a
The way that bbox_inches='tight' is implemented we need to ensure that
we do not try to adjust the aspect during the draw (because we have
temporarily de-coupled the reported figure size from the transforms
which results in the being distorted).  Previously we did not have a
way to fix the aspect ratio in screen space of the Axes (only the
aspect ratio in dataspace) however in 3.3 we gained this ability for
both Axes (matplotlib#14917) and Axes3D (matplotlib#8896 / matplotlib#16472).

Rather than add an aspect value to `set_aspect` to handle this case,
in the tight_bbox code we monkey-patch the `apply_aspect` method with
a no-op function and then restore it when we are done.  Previously we
would set the aspect to "auto" and restore it in the same places.

closes matplotlib#16463.
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Jun 4, 2020
@tacaswell
FIX: support bbox_inches='tight' for box_aspect Axes
c0ab395
The way that bbox_inches='tight' is implemented we need to ensure that
we do not try to adjust the aspect during the draw (because we have
temporarily de-coupled the reported figure size from the transforms
which results in the being distorted).  Previously we did not have a
way to fix the aspect ratio in screen space of the Axes (only the
aspect ratio in dataspace) however in 3.3 we gained this ability for
both Axes (matplotlib#14917) and Axes3D (matplotlib#8896 / matplotlib#16472).

Rather than add an aspect value to `set_aspect` to handle this case,
in the tight_bbox code we monkey-patch the `apply_aspect` method with
a no-op function and then restore it when we are done.  Previously we
would set the aspect to "auto" and restore it in the same places.

closes matplotlib#16463.
@jklymak jklymak mentioned this pull request Jul 23, 2020
v. 3.3.0: horizontal colorbar broken #18033
Closed
@liuzhenqi77 liuzhenqi77 mentioned this pull request Jun 17, 2021
Add custom_aspect parameter to plot_point_brain. netneurolab/netneurotools#104
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@anntzer anntzer anntzer approved these changes
@jklymak jklymak jklymak approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic: mplot3d

Projects

None yet

Milestone

v3.3.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@eric-wieser @anntzer @jklymak
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.