代码之家  ›  专栏  ›  技术社区  ›  relima

matplotlib中有9个子块以上

  •  38
  • relima  · 技术社区  · 16 年前

    在matplotlib中可以得到9个子块以上吗?

    我是副机长 pylab.subplot(449); 我怎么能得到一个 4410 去工作?

    非常感谢你。

    3 回复  |  直到 11 年前
        1
  •  64
  •   Iharob Al Asimi    11 年前

    这比我想象的要容易,我只是做了: pylab.subplot(4,4,10) 而且成功了。

        2
  •  4
  •   Roman    11 年前

    您也可以使用pyplot这样做:

    import matplotlib.pyplot as plt
    oFig1 = plt.figure(1)
    
    oFig1.add_subplot(4,4,11)      #(m,n,x) -> x starts with 1
    ...
    
        3
  •  0
  •   m13op22    7 年前

    你也可以

    import matplotlib.pyplot as plt
    
    N = 10 # number of subplots you want
    fig, axes = plt.subplots(nrows = N)
    

    那么 len(axes) = N 这意味着每个子图都有一个轴。