diff --git a/tracking/monitors/plotting.py b/tracking/monitors/plotting.py index a2c2f3b2273eb49601c3a212ad947b4338ec3929..569dee0ecb748fabf8a7643ff3e519ba5682edec 100644 --- a/tracking/monitors/plotting.py +++ b/tracking/monitors/plotting.py @@ -302,8 +302,9 @@ def plot_bunchdata(filenames, bunch_number, dataset, dimension="x", x_axis = file[group]["time"][:] xlabel = "Number of turns" - - fig, ax = plt.subplots() + + if i == 0: + fig, ax = plt.subplots() ax.plot(x_axis, y_var) ax.set_xlabel(xlabel) ax.set_ylabel(label)