Python: A4 size for a plot
matplotlib, python
Solution
Try to set the size of the figure (in inches) before you save it. You can do this when you initialize the figure by doing:
figure(figsize=(11.69,8.27)) # for landscape
or if the figure exists:
f = gcf() # f = figure(n) if you know the figure number
f.set_size_inches(11.69,8.27)
or in advance for all plots, using
rc('figure', figsize=(11.69,8.27))
Problem
I have a code that saves a figure with: ``` savefig("foo.eps", orientation = 'portrait', format = 'eps') ``` If I don't specify anythingelse, the figure is correctly saved but when I print it, the figure fills only the half of a A4 sheet.If I modify the string as: ``` savefig("foo.eps", papertype = 'a4', orientation = 'portrait', format = 'eps') ``` Nothing chages! How can I set the size of the figure in a way that it fills the whole A4 sheet? Many thanks in advance.