In this example, width = 2 inch and height = 6 inch. The explanation is same as stated in the above examples, the only thing that is changed is the value of width and height. Now, you can see that the width of the figure is 1/3rd the height of the figure. Again this change will make the figure in the shape of something like a rectangular shape. Let say we want to set the width of the figure to 2 inches and height to 6 inches.
Let say we want to set the width of the figure to 6 inches and height to 2 inches. Rectangular shape of figure in Matplotlib with Python
Square size figure in Matplotlib with Python import matplotlib.pyplot as plt If we don’t use the property to change or set the size of figure, then it takes width and height both same and the result will be a square type figure.
#PLT SUBPLOT SIZE HOW TO#
The main motto of this article is how to change or set the size of a figure in Matplotlib using Python. In this article, we need some basic concept of two python module named as “Matplotlib” and “Numpy”.