This commit is contained in:
Diana 2024-10-28 17:32:19 +01:00
parent 91f27157dc
commit 22f533db85

View File

@ -114,8 +114,6 @@ def plot_highlighted_integrals(ax, frequency, power, points, nyquist, true_eodf,
}
# Plot the power spectrum on the provided axes
for point in points:
# Identify the category for the current point
point_category = next((cat for cat, pts in points_categories.items() if point in pts), "Unknown")
@ -131,7 +129,7 @@ def plot_highlighted_integrals(ax, frequency, power, points, nyquist, true_eodf,
# Highlight valid points with a shaded region
ax.axvspan(point - delta, point + delta, color=color, alpha=0.35, label=f'{point_category}')
ax.plot(frequency, power)
ax.plot(frequency, power, color="#1f77b4", linewidth=1.5)
# Use the category colors for 'Nyquist' and 'EODf' lines
ax.axvline(nyquist, color=category_colors.get("Nyquist", "#2ca02c"), linestyle="--")
ax.axvline(true_eodf, color=category_colors.get("EODf (awake fish)", "#8c564b"), linestyle="--")
@ -140,7 +138,7 @@ def plot_highlighted_integrals(ax, frequency, power, points, nyquist, true_eodf,
ax.set_xlim([0, 1200])
ax.set_ylim([0, 6e-5])
ax.set_xlabel('Frequency (Hz)', fontsize=12)
ax.set_ylabel(r'Power [$\frac{\mathrm{mV^2}}{\mathrm{Hz}}$]', fontsize=12)
ax.set_ylabel(r'Power [$\frac{\mathrm{Hz^2}}{\mathrm{Hz}}$]', fontsize=12)
#ax.set_title('Power Spectrum with highlighted Integrals', fontsize=14)
# Apply float formatting to the y-axis