2017-06-17 20 views
2

我想弄清楚如何用Plots.jl创建表面图。然而Plots.jl - 将表面颜色映射到矩阵

enter image description here

using Plots 
plotlyjs() 
# Read the theta and phi angles from file... 
x2d = sind(theta2d).*cosd(phi2d) 
y2d = sind(theta2d).*sind(phi2d) 
z2d = cosd(theta2d) 
surface(x2d,y2d,z2d) 

,我希望有表面颜色由像下面(与Python所作的曲线图的单独基质进行控制:我可以从2-d目象下面创建的球形表面)。

enter image description here

from mayavi import mlab 
# Create/read plot data... 
mlab.figure(bgcolor=(1,1,1), fgcolor=(0.,0.,0.)) 
mlab.mesh(x2d, y2d, z2d, scalars=p2d, colormap='jet', vmax=5, vmin=-35) 

也许我应该只需要直接使用Python绘图函数?或者,也许直接GLVisualize?

谢谢!

回答

2

您可以将控制颜色的矩阵提供为fill_z关键字。它不适用于所有后端,但请尝试plotljys和pyplot。

+1

正是我在找的东西 - 我测试了PyPlot和PlotlyJS。谢谢! – nalyd88