2015-10-14 165 views
8

有沒有什麼方法可以將輪廓標籤放入3D圖中? Clabel顯然不是在3Dmatplotlib在3D中輪廓標籤

實施
import numpy as np 
from mpl_toolkits.mplot3d import Axes3D 
import matplotlib.pyplot as plt 

x,y = np.meshgrid(np.linspace(-1,1,10),np.linspace(-1,1,10)) 
z=-(x**2+y**2) 

fig,ax = plt.subplots() 
C=ax.contour(x,y,z) 
ax.clabel(C) 

fig = plt.figure() 
ax = fig.add_subplot(111,projection='3d') 
C=ax.contour(x,y,z,zdir='z',offset=-2) 
ax.clabel(C) 

enter image description here enter image description here

回答