...

/

Figure size, aspect ratio and DPI

Figure size, aspect ratio and DPI

Let’s learn about managing the figure size, aspect ratio, and DPI of images using matplotlib.

Figure size

When creating a figure object, matplotlib allows the aspect ratio, DPI and figure size to be specified. We can do these using the following methods:

  • figsize: This allows us to adjust the width and height of the figure in inches.

  • dpi: This allows us to specify the number of pixels or dots per inch.

Access this course and 1400+ top-rated courses and projects.