Python with matplotlib - drawing multiple figures in parallel

前端 未结 3 2024
天命终不由人
天命终不由人 2020-12-29 03:04

I have functions that contribute to small parts of a figure generation. I\'m trying to use these functions to generate multiple figures? So something like this:

3条回答
  •  悲哀的现实
    2020-12-29 03:40

    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()
    

提交回复
热议问题