FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Resizing a GUI window with Axes3D · Issue #1104 · matplotlib/matplotlib · GitHub

Repository navigation

Resizing a GUI window with Axes3D #1104

Closed

Description

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.

Activity

  1. added this to the milestone on Aug 18, 2014
  2. solarjoe commented on Jan 18, 2016

    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.

  3. modified the milestones: , v3.3.0 on Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL