Plot formatting improved

This commit is contained in:
2023-03-03 10:54:16 +01:00
parent b3edafa796
commit 767f6e39f8
+5
View File
@@ -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