Setting the size of the plotting canvas in Matplotlib

后端 未结 2 456
闹比i
闹比i 2020-12-08 05:34

I would like Matplotlib/Pyplot to generate plots with a consistent canvas size. That is, the figures can well have different sizes to accomodate the axis descriptions, but t

2条回答
  •  情歌与酒
    2020-12-08 05:44

    You can specify the following settings in Matplotlib rc:

    import matplotlib
    matplotlib.rcParams['figure.figsize'] = [10, 10] # for square canvas
    matplotlib.rcParams['figure.subplot.left'] = 0
    matplotlib.rcParams['figure.subplot.bottom'] = 0
    matplotlib.rcParams['figure.subplot.right'] = 1
    matplotlib.rcParams['figure.subplot.top'] = 1
    

提交回复
热议问题