Skip to content

Commit

Permalink
Fix plotting of just the relevant part of the spectrum
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Sep 26, 2023
1 parent d2df1ee commit f9f1421
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions stingray/crossspectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,11 @@ def plot(
ax = fig.add_subplot(1, 1, 1)

ax.plot(self.freq, np.abs(self.power), marker, color="b", label="Amplitude")
ax.plot(self.freq, self.power.real, marker, color="r", alpha=0.5, label="Real Part")
ax.plot(self.freq, self.power.imag, marker, color="g", alpha=0.5, label="Imaginary Part")
if np.any(np.iscomplex(self.power.imag)):
ax.plot(
self.freq, self.power.imag, marker, color="g", alpha=0.5, label="Imaginary Part"
)
ax.plot(self.freq, self.power.real, marker, color="r", alpha=0.5, label="Real Part")

if labels is not None:
try:
Expand Down

0 comments on commit f9f1421

Please sign in to comment.