import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
u = np.linspace(0,2*np.pi,100)
v = np.linspace(0,0.5*np.pi,50)
R0 = 1
xhf = R0*np.outer(np.cos(u),np.sin(v))
yhf = R0*np.outer(np.sin(u),np.sin(v))
zhf = R0*np.outer(np.ones(np.size(u)),np.cos(v))
fig = plt.figure()
ax = fig.add_subplot(111,projection='3d')
ax.plot_surface(xhf,yhf,zhf,rstride=5,cstride=5,cmap=cm.coolwarm)
plt.show()
I can use the above code to draw a semi-spherical surface, the color is assigned by the scale of the z coordinate. But i want to use the color to show another aspect of the surface, like the density, temperature distribution, etc. BTW, I have got that parameter distribution on the surface.