How to make several plots on a single page using matplotlib?

前端 未结 5 2034
离开以前
离开以前 2020-11-27 12:27

I have written code that opens 16 figures at once. Currently they all open as separate graphs. I\'d like them to open all on the same page. Not the same graph. I want 16

5条回答
  •  青春惊慌失措
    2020-11-27 13:10

    Since this question is from 4 years ago new things have been implemented and among them there is a new function plt.subplots which is very convenient:

    fig, axes = plot.subplots(nrows=2, ncols=3, sharex=True, sharey=True)
    

    where axes is a numpy.ndarray of AxesSubplot objects, making it very convenient to go through the different subplots just using array indices [i,j].

提交回复
热议问题