Advanced Subplots

Build on your knowledge of subplots to undertake advanced customization and formatting.

Unevenly distributed plots

What if we want our plots to take up unequal space on our main figure?

Uneven column widths

It turns out that by passing a list to column_widths inside make_subplots, we can have our subplots take up unequal space. The values are normalized internally but be sure to have the column widths add to one for maximum code interpretability. Here we have set 65% (0.65) of the total width for the first subplot and 35% (0.35) for the second subplot. This is seen in the next code cell.

Uneven row widths

Instead of column_widths, we can use row_heights if we stack subplots vertically. We demonstrate this in the code cell after the next one.

Get hands-on with 1200+ tech skills courses.