pyplot交互地画多个plot
生活随笔
收集整理的這篇文章主要介紹了
pyplot交互地画多个plot
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
下面的代碼,可以無阻礙地show 5個figure,相當于開啟了ipython的interactive 模式
具體參見stackoverflow:?in matplotlib, is there a way to pop up a figure asynchronously?
1 #!/usr/bin/python 2 import pylab as plb 3 import matplotlib.pyplot as plt 4 def show_figure():5 fig1=plt.figure(1) 6 ax = fig1.add_subplot(1,1,1) 8 ax.plot([1,2,3],[4,5,6],'ro-') 11 plt.ion() # turns on interactive mode 12 plt.show() # now this should be non-blocking 13
for i in range(5):
show_figure()
14 print "doing something else now" 15 raw_input('Press Enter to continue...')
?
轉載于:https://www.cnblogs.com/andy-0212/p/10062938.html
總結
以上是生活随笔為你收集整理的pyplot交互地画多个plot的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微星刀锋 无法进入bios_微星MPG
- 下一篇: 邻接矩阵的建立