Layouts¶
Boomslang supports two different ways to lay out plots:
boomslang.PlotLayout.PlotLayout
and
boomslang.WeightedPlotLayout.WeightedPlotLayout
.
-
class
boomslang.PlotLayout.
PlotLayout
¶ Displays multiple
boomslang.Plot.Plot
objects in one canvas in a grid, allowing the user to group related Plots in the same row.-
addPlot
(plot, grouping=None)¶ Add plot (a
boomslang.Plot.Plot
) to the layout. Optionally, specify a group name with grouping. Plots grouped in the same grouping are drawn on the same row of the grid.
-
groupOrder
= None¶ If not None, a list of groups in order by the order in which they should be displayed
-
plot
()¶ Draw this layout to a matplotlib canvas.
-
save
(filename, **kwargs)¶ Save this layout to a file.
-
setFigureDimensions
(x, y, dpi=100)¶ Set the dimensions of the layout to be x by y. This overrides any values set with
boomslang.PlotLayout.PlotLayout.setPlotDimensions()
.
-
setPlotDimensions
(x, y, dpi=100)¶ Set the dimensions of each plot in the layout to be x by y.
-
width
¶ The width, in number of plots, of the layout.
-
-
class
boomslang.WeightedPlotLayout.
WeightedPlotLayout
¶ A more sophisticated version of
boomslang.PlotLayout.PlotLayout
that allows some plots to be wider than others.Like PlotLayout, WeightedPlotLayout allows plots to be grouped together into named groupings, with one grouping per row. However, it does not have a fixed width in number of plots to guide layout. Instead, the _weights_ of the plots in a grouping determine how wide each plot in the grouping is. Any plot that has no grouping or is the only plot in its grouping will take up an entire row regardless of its weight.
For example, if there are two plots in a grouping and both plots have weight 1, they will each take up half the row. If one of the plots has weight 2 and the other has weight 1, the first plot will take up 2/3 of the row and the second will take up the remaining 1/3.
-
addPlot
(plot, grouping=None, weight=1)¶ Add plot to the layout, optionally grouping it with all other plots added to the group grouping. weight denotes the plot’s weight within its grouping.
-
plot
()¶ Draw this layout to a matplotlib canvas.
-
save
(filename, **kwargs)¶ Save this layout to a file.
-