How to change the size of just the plots in Matplotlib, as in the rectangle within which plot exists? 'figsize' changes the size of the whole image

278 views Asked by At

In Python the 'figsize' sets the size of the whole image, so if there are two decimal points in ticks, the figure size is different when ticks have 4 decimal points. How can I set the size of just the rectangle within which the plot exists so the plot size remains same irrespective of the tick or label size? For comparison, the following images have same fig size, but different tick size, which makes the plot of different sizes.

1

There are 1 answers

2
A.M. Ducu On

You could try to use the "dpi" parameter when setting the figure. I.e. figure(figsize=(3, 3), dpi=100)

More info about it here and here.