When using tight_layout the figure padding changes for different figure.dpi settings. This is caused by an error in when converting from points to inches. A point is always 1/72 inch and does not depend on the dots per inches.
Ooooh, good catch! I suspect this may also require updating test images. We probably should also double-check this in axes_grid1 in the mpl_toolkits.
looks like axes_grid1 is unaffected, I think.
Indeed, the tests for tight_layout fail with this PR (which isn't a bad thing!). Note that in my test runs (using an older freetype), the layout is "less tight" now than before. This may mean that we need to adjust some of the default parameters.
Hm, at least for my matplotlib installation the default figure.dpi is 80. I assume this is the default for the tests as well? If so, the borders will grow by 80/72 = 11% after applying this patch. You think it's best to reduce the default tight_layout defaults by that fraction?
Do you get an additional difference for other freetype libraries or is your experience explained by that 11% fraction?
Ok, when I change all ocurences of pad=1.2 to pad=1.08 all tight_layout tests pass except tight_layout6_svg, but this seems to be a simple rounding error. I added another commit that includes these new defaults and updates the expected image. Shall I combine these commits into one for the pull request?
No need to combine commits into one (actually, I prefer multiple commits in a PR as it helps me to see what actions were taken to address various comments). I will test this branch out a bit and double-check for any lingering references to the old padding values.
fixed conversion from pt to inch in tight_layout
Rebased the commits on current master and fixed another pad=1.2 default in tight_layout.py that has been added by a recent commit. Also, correcting the padding value in test_tightlayout.py instead of uploading a new test image made the patch less noisy ;).
restore previous tight_layout padding results by correcting the defaults
The tests pass for me (except for knownfails due to my freetype version). Merging...