0
我有一個具有指定顏色圖的表面圖。以下是我如何得到它:matplotlib自定義三維表面圖的顏色圖
import numpy as np
import matplotlib.pyplot as plt
import math
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import plaque_vessel_models
# Model creation
ptX= []
ptY = []
ptZ = []
ptX1 = []
ptY1 = []
ptZ1 = []
pt_F = []
ang = np.linspace(0,2*np.pi,360)
x_list = [100,90,80,70,60,50,40,30,20,10,5]
for i in range(0,10):
x = []
y = []
z = []
pt = []
for t in range(0,len(ang)):
x.append(x_list[i]*math.cos(ang[t]))
y.append(50*math.sin(ang[t]))
z.append(i)
pt.append([x,y,z])
pt_F.append(pt)
ptX.append(x)
ptY.append(y)
ptZ.append(z)
# Surface plot
fig = plt.figure()
ax = Axes3D(fig)
C_l = plaque_vessel_models.curvature3D(np.array(ptX),np.array(ptY),np.array(ptZ),'m')
ax.plot_surface(np.array(ptX),np.array(ptY),np.array(ptZ),facecolors = cm.jet(np.array(C_l)),rstride=1, cstride=5,antialiased=False)
m = cm.ScalarMappable(cmap = cm.jet)
m.set_array(C_l)
fig.colorbar(m,shrink = 0.5)
這是我的結果:
我想要的顏色條值範圍爲0.5 - 1.0,而不是默認0-1。我應該如何處理這個問題?