由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - ploting 3D surface in python
相关主题
~解答 Install matplotlib package in Pythonnumpy installation error: Python was built with Visual Studio 2003;
Python:请问如何把list变成structured array。 (转载)是否需要顺便学点别的编程语言,比如C++ java啥的
安装NumPy碰到困难。pandas这个东西有点意思
咣,咣,咣,上书了!Quick R guide.也谈为什麽要学习Python(对Python没兴趣的请跳过:-)
Matlab和R会不会都最后被Python搞定了?scala应该努力成为学术圈内的工具 (转载)
请教在python里面用RPy call R时的数据类型转换。问题回复: Python为啥只有两个小时的课?
问一下SQL in Python。大家知道statsguy靠谱吗?
Numpy problem大家抱怨下R的问题吧
相关话题的讨论汇总
话题: try话题: 3d话题: import话题: 70话题: axes3d
进入Statistics版参与讨论
1 (共1页)
l******9
发帖数: 579
1
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.
S******y
发帖数: 1123
2
try this -
x,y = np.meshgrid(x,y)
------------------------------------------------------------------------
http://plus.google.com/+statsGuyMITBBS/about
------------------------------------------------------------------------

【在 l******9 的大作中提到】
: 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)

1 (共1页)
进入Statistics版参与讨论
相关主题
大家抱怨下R的问题吧Matlab和R会不会都最后被Python搞定了?
如何处理下面这种情况请教在python里面用RPy call R时的数据类型转换。
sas or python 读取 excel data file问一下SQL in Python。
啥时候开始找全职工作?Numpy problem
~解答 Install matplotlib package in Pythonnumpy installation error: Python was built with Visual Studio 2003;
Python:请问如何把list变成structured array。 (转载)是否需要顺便学点别的编程语言,比如C++ java啥的
安装NumPy碰到困难。pandas这个东西有点意思
咣,咣,咣,上书了!Quick R guide.也谈为什麽要学习Python(对Python没兴趣的请跳过:-)
相关话题的讨论汇总
话题: try话题: 3d话题: import话题: 70话题: axes3d