Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MNT]: The new default x and ymargin setting is too wasteful #25599

@nikohansen

Description

@nikohansen

Summary

The current margin setting, 0.05=5%, reserves 19% of the plotting area as additional margin and hence blank (wasted) space. A margin of 0.01=1% reserves/wastes only 4% and would be a better default.

Proposed fix

The default setting should be amended to 0.01 which would add 18.6% usable area.

The amount of wasted space is surprising, given the margin is only 5%. However, we have 4 margins, hence we should expect to waste roughly 4x5% = 20%. More precisely, the plotting area fraction computes to (1 - 2 * 0.05)**2 = 0.81 of the original area.

A margin of 1% is probably what the default margin setting actually intended, as this removes 4% of the usable area (1 - 2 * 0.01)**2 = 0.96.

Changing the margin from 5% to 1% adds 18.6% to the plotting area ((1 - 2 * 0.01)**2 / (1 - 2 * 0.05)**2 = 1.186), or, the other way around, it makes the plot content 18.6% larger without changing the overall plot size.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions