将标签添加到线框图中,面颜色不是edg

2024-06-28 19:49:18 发布

您现在位置:Python中文网/ 问答频道 /正文

下面是matplotlib documentation for wireframe中的一个有效的、稍加修改的最小示例。你知道吗

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt


fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# Grab some test data.
X, Y, Z = axes3d.get_test_data(0.05)

# Plot a basic wireframe.
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10,color='black',facecolors='green',label='abc')

ax.legend()

plt.show()

enter image description here

我的问题是,图例是黑色的,应该是绿色的。

我该怎么改变呢?你知道吗

如果不可能,我怎么假装呢?我能做一些类似plot(nothing,color='green',legend='abc')的事情吗?你知道吗


Tags: testimportdataplotmatplotlibdocumentationfigplt