我有一个带有指定色彩图的表面图。以下是我如何得到它:
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)
这是我的结果:
我希望colorbar值的范围是0.5 - 1.0而不是默认的0-1。我该怎么做呢?
答案 0 :(得分:2)
Choose Sources...