How do you change the size of figures drawn with matplotlib?

后端 未结 19 3014
忘掉有多难
忘掉有多难 2020-11-21 06:01

How do you change the size of figure drawn with matplotlib?

19条回答
  •  离开以前
    2020-11-21 06:36

    figure tells you the call signature:

    from matplotlib.pyplot import figure
    figure(num=None, figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k')
    

    figure(figsize=(1,1)) would create an inch-by-inch image, which would be 80-by-80 pixels unless you also give a different dpi argument.

提交回复
热议问题