Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Resizing a GUI window with Axes3D #1104

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

Closed
akhmerov opened this issue Aug 18, 2012 · 1 comment · Fixed by #8896
Closed

Resizing a GUI window with Axes3D #1104

akhmerov opened this issue Aug 18, 2012 · 1 comment · Fixed by #8896
Milestone

Comments

@akhmerov
Copy link
Contributor

If a GUI window with Axes3D is resized, the Axes content is rendered into the resized rectangle, which has a different aspect ratio. This causes the image to be distorted. Together with #1077 this makes 3D plotting very poorly suited for plotting 3D data where all three axes are related, importantly real space data.

@tacaswell tacaswell added this to the unassigned milestone Aug 18, 2014
@solarjoe
Copy link

I also came across this issue, here some code to verify it.
If the image is set to fullscreen, the axes are distorted but as soon as the plot is rotated or zoomed the figure refreshes and uses correct rendering.

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

fig = plt.figure(figsize=(11.7,  8.3), dpi=72.0)

ax = fig.add_subplot(111, projection='3d')

data = np.array([[0.0, 0.0, 0.0],
                 [0.0, 0.0, 1.0],
                 [1.0, 0.0, 1.0],
                 [1.0, 1.0, 1.0],
                 [1.0, 1.0, 0.0]])

#also happens with ax.plot, ax.scatter, ax.plot_trisurf
cs = ax.plot(data[:,0], data[:,1], data[:,2], 'b-')

ax.set_aspect('equal')
ax.auto_scale_xyz([0.0, 1.0], [0.0, 1.0], [0.0, 1.0])

plt.show()

This also seems to be related to #1077 in some way, I just could not figure out how.
If you comment ax.set_aspect('equal') the fullscreen plot looks correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants