@@ -16,24 +16,31 @@ class plot_layout(ComposeAddable):
1616 Customise the layout of plots in a composition
1717 """
1818
19- widths : Sequence [ float ] | None = None
19+ nrow : int | None = None
2020 """
21- Relative widths of each column
21+ Number of rows
2222 """
2323
24- heights : Sequence [ float ] | None = None
24+ ncol : int | None = None
2525 """
26- Relative heights of each column
26+ Number of columns
2727 """
2828
29- nrow : int | None = None
29+ byrow : bool | None = None
3030 """
31- Number of rows
31+ How to place plots into the grid.
32+ If None or True, they are placed row by row, left to right.
33+ If False, they are placed column by column, top to bottom.
3234 """
3335
34- ncol : int | None = None
36+ widths : Sequence [ float ] | None = None
3537 """
36- Number of columns
38+ Relative widths of each column
39+ """
40+
41+ heights : Sequence [float ] | None = None
42+ """
43+ Relative heights of each column
3744 """
3845
3946 _cmp : Compose = field (init = False , repr = False )
@@ -84,6 +91,10 @@ def _setup(self, cmp: Compose):
8491
8592 nrow , ncol = self .nrow , self .ncol
8693
94+ # byrow
95+ if self .byrow is None :
96+ self .byrow = True
97+
8798 # setup widths & heights
8899 ws , hs = self .widths , self .heights
89100 if ws is None :
@@ -111,6 +122,8 @@ def update(self, other: plot_layout):
111122 self .ncol = other .ncol
112123 if other .nrow :
113124 self .nrow = other .nrow
125+ if other .byrow is not None :
126+ self .byrow = other .byrow
114127
115128
116129def repeat (seq : Sequence [float ], n : int ) -> list [float ]:
0 commit comments