由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - ploting 3D surface in python (转载)
相关主题
ploting 3D surface in python (转载)solve integral eq. embeeded with another integral eq. (转载)
求建议,Google Quantitative analyst 面试用R 还是PythonAlgorithms: combination --Python code
求职困境中,请帮推荐entry level data analyst opening请教一道面试题
error draw map from shape file Python 3.2 basemap (转载)twoSum
free back test tool in python - for quant algos (转载)python的int问题
从Linux到windows怎么破问个python的code
请教Python和Java的前景,和如何积累经验这种情况应该pip还是……
也不能乱黑python练习javascript和python, 有什么side project推荐吗? (转载)
相关话题的讨论汇总
话题: 3d话题: import话题: 70话题: ploting话题: result
进入JobHunting版参与讨论
1 (共1页)
l******9
发帖数: 579
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.
b******6
发帖数: 38
2
x, y and result needs to be 2d array, add this line to your code: x, y = np.
meshgrid(x, y).
1 (共1页)
进入JobHunting版参与讨论
相关主题
练习javascript和python, 有什么side project推荐吗? (转载)free back test tool in python - for quant algos (转载)
新人求助,如何找合适的Project提升实力(Java & Python)从Linux到windows怎么破
Facebook面试会问怎样的behavior questions,怎么准备好?请教Python和Java的前景,和如何积累经验
准备不好面试就是会悲剧也不能乱黑python
ploting 3D surface in python (转载)solve integral eq. embeeded with another integral eq. (转载)
求建议,Google Quantitative analyst 面试用R 还是PythonAlgorithms: combination --Python code
求职困境中,请帮推荐entry level data analyst opening请教一道面试题
error draw map from shape file Python 3.2 basemap (转载)twoSum
相关话题的讨论汇总
话题: 3d话题: import话题: 70话题: ploting话题: result