Matplotlib 提供了 Matlab 提供的几乎所有绘图选项。曲面图也可以完成: http: //matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#surface-plots
要加载图像,scipy 有一个 PIL 包装器(不包括小丑,抱歉),它加载与 matplotlib 兼容的 numpy 数组。
总而言之,您需要以下软件包:numpy、scipy、matplotlib 和 PIL。这四个库的组合应该可以满足您的所有需求。还要查看这些库的 pylab 接口,因为它与 Matlab 非常相似。
我相信你想做的例子:
from mpl_toolkits.mplot3d import Axes3D
from scipy.misc import imread
from matplotlib.pyplot import figure, show
from numpy import linspace, meshgrid, sqrt, sin, mean, flipud
clown = imread('clown.png')
fig = figure()
ax = fig.gca(projection='3d')
X = linspace(-5, 5, clown.shape[0])
Y = linspace(-5, 5, clown.shape[1])
X, Y = meshgrid(X, Y)
R = sqrt(X**2 + Y**2)
Z = sin(R)
clown = clown.swapaxes(0,1) / 255. # meshgrid orients axes the other way around, scaling of rgb to [0-1]
ax.plot_surface(X, Y, Z, facecolors=flipud(clown))
ax.view_init(45,-35) # swapped wrt matlab
show()