Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用几条单独的等高线和一个颜色条制作一个填充的等高线图,就像 matplotlib教程中 的“带颜色条的线”图那样想立即显示。我希望例程将其返回以进行进一步的可选处理。有没有办法做到这一点?谢谢。
只要您没有打开交互模式(即通过调用plt.ion()),您的绘图将不会显示,直到您调用
plt.ion()
plt.show()
因此,要继续在同一轴上绘图,只需继续调用plt.plot或plt.contourf等绘图函数即可。这些调用是否来自例程无关紧要)。
plt.plot
plt.contourf