设置matplotlib 3d绘图长宽比? [英] set matplotlib 3d plot aspect ratio?

查看:269
本文介绍了设置matplotlib 3d绘图长宽比?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

设置纵横比适用于二维图:

Setting the aspect ratio works for 2d plots:

ax = plt.axes()
ax.plot([0,1],[0,10])
ax.set_aspect('equal','box')

但不适用于3d:

ax = plt.axes(projection='3d')
ax.plot([0,1],[0,1],[0,10])
ax.set_aspect('equal','box')

3d情况是否有其他语法,或者没有实现?

Is there a different syntax for the 3d case, or it's not implemented?

推荐答案

我的理解基本上是尚未实现.我也希望它能尽快实施.有关可能的解决方案,请参见此链接(我尚未测试它是我自己的.)

My understanding is basically that this isn't implemented yet. I'm also hoping that it is implemented soon. See This link for a possible solution (I haven't tested it myself).

这篇关于设置matplotlib 3d绘图长宽比?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆