From 767f6e39f8a64b00ef0ff0ae59824fa7ac1aecf3 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Fri, 3 Mar 2023 10:54:16 +0100 Subject: [PATCH] Plot formatting improved --- src/csv_threading.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/csv_threading.py b/src/csv_threading.py index 07ef2a7..96cbeb5 100644 --- a/src/csv_threading.py +++ b/src/csv_threading.py @@ -257,9 +257,11 @@ def plot_field_sequence(array, width, height): # create plot of fixed size (pix plot.text(t[-1], min_val, "min", horizontalalignment='center', color='r') plot.set_title(g.AXIS_NAMES[i], size=10) # set subplot title (e.g. "X-Axis") + plot.grid() # plot rotation rate plot = axes[3] plot.plot(t, new_array[:, 4], linestyle='solid', marker='.') # plot data + plot.grid() plot.set_title("Abs. Rotation Rate", size=10) # set subplot title (e.g. "X-Axis") # set ylim of magnetic field axis to same value ylim_mag = ([min(axes[0].get_ylim()), max(axes[0].get_ylim()), @@ -272,5 +274,8 @@ def plot_field_sequence(array, width, height): # create plot of fixed size (pix axes[3].set_xlabel("Time [s]") axes[1].set_ylabel("Magnetic Field [\u03BCT]") axes[3].set_ylabel("Rate [°/s]") + # set y axis limits + for i in range(4): + axes[i].set_xlim(left=-round((new_array[-1, 0]+0.5)*0.01), right=round((new_array[-1, 0]+0.5)*1.01)) return figure # return the created figure to be inserted somewhere