plot_utils: the height and width of pre_plot_setup() are the ones of the row of plots
This worked ok until pre_plot_setup() learnt to plot multiple rows of
plots. With this patch, this works again.
diff --git a/cr2/plot_utils.py b/cr2/plot_utils.py
index ae1e750..933e99f 100644
--- a/cr2/plot_utils.py
+++ b/cr2/plot_utils.py
@@ -53,8 +53,9 @@
def pre_plot_setup(width=None, height=None, ncols=1, nrows=1):
"""initialize a figure
- width and height are numbers. This function should be called
- before any calls to plot()
+ width and height are the height and width of each row of plots.
+ For 1x1 plots, that's the height and width of the plot. This
+ function should be called before any calls to plot()
"""
@@ -68,6 +69,8 @@
if width is None:
width = height * GOLDEN_RATIO
+ height *= nrows
+
_, axis = plt.subplots(ncols=ncols, nrows=nrows, figsize=(width, height))
# Needed for multirow blots to not overlap with each other