1
2
3
4
5
6
7
8
9
10
11
12
| # colors = [ [30,70,110], [55,103,149],[82,143,173],[114,188,213],[170,220,224],[255,230,183],[255,208,111],[247,170,88], [239,138,71],[231,98,84]]
colors = [[49,124,183], [128,166,226],[251,221,133],[244,111,67],[207,67,62]]
# colors = [[49,124,183],[182,215,232],[233,241,244],[251,227,213],[246,178,147],[220,109,87],[183,34,48],[109,1,31]]
colors = [list(map(div, x)) for x in colors ]
cmap = mcolors.LinearSegmentedColormap.from_list("my_cmap", colors)
color = (np.exp(z) - np.exp(-1)) / (np.exp(1) - np.exp(-1))
# alpha controls opacity
ax.plot_surface(x, y, z, rstride=1, cstride=1,facecolors = cmap(color),linewidth=0.1, alpha=0.8)
|