【发布时间】:2016-09-11 19:56:47
【问题描述】:
假设我运行以下脚本:
import matplotlib.pyplot as plt
lineWidth = 20
plt.figure()
plt.plot([0,0],[-1,1], lw=lineWidth, c='b')
plt.plot([-1,1],[-1,1], lw=lineWidth, c='r')
plt.plot([-1,1],[1,-1], lw=lineWidth, c='g')
plt.show()
这会产生以下内容:
如何指定层的从上到下的顺序,而不是让 Python 为我挑选?
【问题讨论】:
-
我看到 zorder 与它有关。但我仍然无法让它按我的意愿工作。如果我将蓝色、红色和绿色线的 zorder 分别设置为 0、1 和 2,则红色线是最上面的那条。为什么??
标签: python matplotlib plot layer