2

I have a surface plot with a specified colormap. Following is how I get it:

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)

This is my result:

enter image description here

I want the colorbar values to range from 0.5 - 1.0 instead of the default 0-1. How should I approach this?

1 Answer 1

3
m.set_clim(vmin=0.5, vmax=1.0)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.