Layout and Subplots

Multiple plots can be added to a single figure using layouts. Inspired by QT’s box layouts, ziaplot.layout.Hlayout and ziaplot.layout.Vlayout take any number of Drawables, including other layouts, as arguments, and stack the plots horizontally or vertically. Note the same line or axis can be added to multiple layouts.

line = zp.Line([1,2,3], [1,2,5])
zp.Hlayout(line, line, height=200)
_images/layout_1_0.svg

Layouts can be stacked together to create more complex figures. Here, two columns are created, each using Vlayouts. Then the two Vlayouts are arranged in a horizontal row using Hlayout.

col1 = zp.Vlayout(line, line)
col2 = zp.Vlayout(line, line, line)
zp.Hlayout(col1, col2)
_images/layout_2_0.svg