如何更改使用 Matplotlib 绘制的图形的大小?

2022-01-30 00:00:00 python matplotlib visualization plot graph

问题描述

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

解决方案

figure tells you the call signature:

from matplotlib.pyplot import figure

figure(figsize=(8, 6), dpi=80)

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.

相关文章