我的图形移动了,并且没有覆盖整个区域。
from mpl_toolkits.mplot3d import axes3d
plt.rcParams['figure.figsize'] = (11,9)
fig = plt.figure()
ax = fig.add_subplot(111) #2D
#ax= fig.gca(projection='3d') #3D
ax.autoscale(enable=True, axis='both', tight=False)
cs = ax.contour(X1, X2_1, Z1, 30)
ax.clabel(cs, fontsize=10)
plt.plot(x1_tr, x2_tr, 'k+')
plt.show()
当我移除plt.plot(x1_tr, x2_tr, 'k+')
时,轮廓变得完美了!