Skip to content

Commit 0976614

Browse files
committed
Clarify side-space module note on margin coordinate bases
Distinguish raw theme.getp("plot_margin_*") floats (fraction of width, need F = W/H for vertical use) from margin.to("fig") values (already in the correct per-edge fractional basis). The previous note described only the former convention, which misled readers about margin.fig.
1 parent c7b9867 commit 0976614

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

plotnine/_mpl/layout_manager/_side_space.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222

2323

2424
# Note
25-
# Margins around the plot are specified in figure coordinates
26-
# We interpret that value to be a fraction of the width. So along
27-
# the vertical direction we multiply by W/H to get equal space
28-
# in both directions
25+
# * theme.getp("plot_margin_*") values are raw floats interpreted as
26+
# fraction of width — multiply by F = W/H for vertical use.
27+
#
28+
# * margin.to("fig") values are already in the correct per-edge
29+
# fractional basis (t|b: fraction of H, l|r: fraction of W) and
30+
# should be used as-is.
2931

3032

3133
class GridSpecParamsError(Exception):

0 commit comments

Comments
 (0)