2017-06-17 58 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