Redian新闻
>
ploting 3D surface in python (转载)
avatar
ploting 3D surface in python (转载)# JobHunting - 待字闺中
l*9
1
【 以下文字转载自 Statistics 讨论区 】
发信人: light009 (light009), 信区: Statistics
标 题: ploting 3D surface in python
发信站: BBS 未名空间站 (Mon Mar 31 16:14:16 2014, 美东)
I would like to make a 3D surfaceplot in python 3.2 by matplotlib on win 7.
My code:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d.axes3d import Axes3D
from mpl_toolkits.mplot3d import axes3d
def plotFunc():
x = np.linspace(0.00001,70 ,10) // x is a list of numbers
y = np.linspace(0.01, 70,10)
result = np.linspace(0.01, 70,10)
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot_surface(x, y, result, rstride=5, cstride=5, alpha=0.3)
ax.set_xlabel('shape')
ax.set_xlim(0, 70)
ax.set_ylabel('scale')
ax.set_ylim(0, 70)
ax.set_zlabel('result')
ax.set_zlim(0, 70)
plt.show()
But, I got nothing in the output except teh three axises.
Any help would be appreciated.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。