Matplotlib figsize incorrect on screen

91 views Asked by At

I would like to obtain a 10x10 cm matplotlib-figure. The following code opens a figure that is 12.2 cm on one screen and 7.0 cm on another screen (PDF in Acrobat Reader: 13.5 / 7.8 cm).

Obviously some screen-scaling issue, but how to fix it? If it was only the PDF displaying incorrectly I wouldn't care, but I want to see the matplotlib figure correctly on my screens. Both windows screen scalings are at 100%.

import matplotlib.pyplot as plt
cm = 1/2.54
fig = plt.figure(figsize = (10 * cm, 10 * cm))
plt.show()
fig.savefig("test.pdf")
0

There are 0 answers