Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Request: non-square axes in axes3D #8593

Closed
@huangziwei

Description

@huangziwei

Currently, we can get non-square axes in axes3D based on a simple hack fromhttp://stackoverflow.com/a/10328142/2135095, by editing theget_proj function inside site-packages\mpl_toolkits\mplot3d\axes3d.py:

def get_proj(self):    relev, razim = np.pi * self.elev/180, np.pi * self.azim/180    try:        self.localPbAspect = self.pbaspect    except AttributeError:        self.localPbAspect = [1,1,1]        xmin, xmax = self.get_xlim3d() / self.localPbAspect[0]    ymin, ymax = self.get_ylim3d() / self.localPbAspect[1]    zmin, zmax = self.get_zlim3d() / self.localPbAspect[2]

then in the code we can set the axes manually:

fig = plt.figure()ax = fig.gca(projection='3d')ax.pbaspect = [1,1,0.5]

it would be great if we can have some generic solution to achieve non-square axes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp