使用Python / Matplotlib的3D图的限制

时间:2018-11-12 18:41:21

标签: python matplotlib jupyter-notebook

设置3D图形的轴限制时出现问题。 我正在使用熊猫读取数据库文件,这些文件只是大气排放量和风速的数字(float64格式)。 但是,当设置一个极限(例如1200雷声和80 km / h的风速)时,我的图就超出了所需的表面。 发生在“ ax.set_xlim3d”,“ ax.set_xlim”和“ plt.xlim”中。

我的代码如下:

fig = plt.figure()
ax = fig.gca(projection='3d')
y = dados['Rajada']
x = dados['Raios']
z = ((1/3080)*(np.exp(2.2507716+(0.0011096*x)+(0.0274958*y))))
ax.set_xlabel('Número de Raios',fontsize=15)
ax.set_ylabel('Rajada Máxima em Km/H',fontsize=15)
ax.set_zlabel('Taxa de Falha por Quilômetro',fontsize=15)
plt.xlim(0,1200)
plt.ylim(0,80)
surf = ax.plot_trisurf(x, y, z, cmap='coolwarm',hatch='/-', edgecolor='none')

Image of how the graph was plotted

0 个答案:

没有答案