如何在mplot3d中缩放轴 [英] How to scale axes in mplot3d

查看:51
本文介绍了如何在mplot3d中缩放轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎找不到有关使用matplotlib缩放3d图像中的轴的功能的文档.

I can't seem to find documentation regarding the ability to scale axes in a 3d image using matplotlib.

例如,我有图像:

和轴有不同的比例.我希望他们穿制服.

And the axes have different scales. I would like them to be uniform.

推荐答案

通常,最容易包含一些生成图像的代码,因此我们可以看到您尝试过的内容以及您的常规设置代码.话虽如此,将以下内容包括在内应该是可行的:

Usually it is easiest for you to include some of the code that generated the image, so we can see what you've tried and also the general setup of your code. That being said, the inclusion of the following should work:

from mpl_toolkits.mplot3d import Axes3D
plt.clf()
fig = pylab.figure()
ax = Axes3D(fig)
ax.set_xlim3d(0, 1000)
ax.set_ylim3d(0,1000)
ax.set_zlim3d(0,1000)

这篇关于如何在mplot3d中缩放轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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