plot_utils: let pre_plot_setup setup multicolumn plots
diff --git a/cr2/plot_utils.py b/cr2/plot_utils.py
index 27ba514..cfd0a93 100644
--- a/cr2/plot_utils.py
+++ b/cr2/plot_utils.py
@@ -50,7 +50,7 @@
"""
set_lim(ylim, ax.get_ylim, ax.set_ylim)
-def pre_plot_setup(width=None, height=None):
+def pre_plot_setup(width=None, height=None, ncols=1):
"""initialize a figure
width and height are numbers. This function should be called
@@ -68,9 +68,9 @@
if width is None:
width = height * GOLDEN_RATIO
- _, ax = plt.subplots(figsize=(width, height))
+ _, axis = plt.subplots(ncols=ncols, figsize=(width, height))
- return ax
+ return axis
def post_plot_setup(ax, title="", xlabel=None, xlim="default", ylim="range"):
"""Set xlabel, title, xlim adn ylim of the plot