Skip to content

Commit

Permalink
Fix broken spectrum plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
AgenttiX committed Dec 3, 2024
1 parent bac24fe commit 26dbcba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pttools/analysis/plot_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def plot_spectrum(
fig, ax = create_fig_ax(fig, ax)
ax.plot(spectrum.y, spectrum.pow_gw, **kwargs)
ax.set_ylabel("pow_gw")
return plot_spectrum_common(SSMSpectrum, fig, ax, path)
return plot_spectrum_common(spectrum, fig, ax, path)


def plot_spectrum_common(spectrum: SSMSpectrum, fig: plt.Figure, ax: plt.Axes, path: str = None) -> FigAndAxes:
Expand All @@ -34,10 +34,10 @@ def plot_spectrum_multi(spectrum: SSMSpectrum, fig: plt.Figure = None, path: str
if fig is None:
fig = plt.figure(figsize=A4_PAPER_SIZE)
axs = fig.subplots(2, 2)
plot_spectrum_spec_den_v(SSMSpectrum, fig, axs[0, 0], **kwargs)
plot_spectrum_spec_den_gw(SSMSpectrum, fig, axs[1, 0], **kwargs)
plot_spectrum_v(SSMSpectrum, fig, axs[0, 1], **kwargs)
plot_spectrum(SSMSpectrum, fig, axs[1, 1], **kwargs)
plot_spectrum_spec_den_v(spectrum, fig, axs[0, 0], **kwargs)
plot_spectrum_spec_den_gw(spectrum, fig, axs[1, 0], **kwargs)
plot_spectrum_v(spectrum, fig, axs[0, 1], **kwargs)
plot_spectrum(spectrum, fig, axs[1, 1], **kwargs)
fig.tight_layout()
if path is not None:
fig.savefig(path)
Expand All @@ -53,7 +53,7 @@ def plot_spectrum_v(
fig, ax = create_fig_ax(fig, ax)
ax.plot(spectrum.y, spectrum.pow_v, **kwargs)
ax.set_ylabel("pow_v")
return plot_spectrum_common(SSMSpectrum, fig, ax, path)
return plot_spectrum_common(spectrum, fig, ax, path)


def plot_spectrum_spec_den_gw(
Expand All @@ -65,7 +65,7 @@ def plot_spectrum_spec_den_gw(
fig, ax = create_fig_ax(fig, ax)
ax.plot(spectrum.y, spectrum.spec_den_gw, **kwargs)
ax.set_ylabel("spec_den_gw")
return plot_spectrum_common(SSMSpectrum, fig, ax, path)
return plot_spectrum_common(spectrum, fig, ax, path)


def plot_spectrum_spec_den_v(
Expand All @@ -77,4 +77,4 @@ def plot_spectrum_spec_den_v(
fig, ax = create_fig_ax(fig, ax)
ax.plot(spectrum.y, spectrum.spec_den_v, **kwargs)
ax.set_ylabel("spec_den_v")
return plot_spectrum_common(SSMSpectrum, fig, ax, path)
return plot_spectrum_common(spectrum, fig, ax, path)

0 comments on commit 26dbcba

Please sign in to comment.