Python with matplotlib - drawing multiple figures in parallel

我与影子孤独终老i 提交于 2019-11-30 04:23:19

There are several ways to do this, and the simplest is to use the figure numbers. The code below makes two figures, #0 and #1, each with two lines. #0 has the points 1,2,3,4,5,6, and #2 has the points 10,20,30,40,50,60.

from pylab import *

figure(0)
plot([1,2,3])

figure(1)
plot([10, 20, 30])

figure(0)
plot([4, 5, 6])

figure(1)
plot([40, 50, 60])

show()

For a more general answer to this question and to questions you may soon have, I would recommend the official tutorial.

The best way to show multiple figures is use matplotlib or pylab. (for windows) with matplotlib you can prepare the figures and then when you finish the process with them you can show with the comand "matplotlib.show()" and all figures should be shown.

(on linux) you don´t have problems adding changes to figures because the interactive mode is enable (on windows the interactive mode don't work OK).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!