-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cross spectrum plotting #763
Conversation
Codecov Report
@@ Coverage Diff @@
## main #763 +/- ##
==========================================
+ Coverage 90.74% 96.14% +5.40%
==========================================
Files 43 43
Lines 7918 7937 +19
==========================================
+ Hits 7185 7631 +446
+ Misses 733 306 -427
... and 14 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
277f96f
to
2ae0315
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @matteobachetti,
this is useful.
One small thing, real and imaginary parts can have very different values, in that case one of the two quantities could be very difficult to read in the plot.
Have you thought of using
ax2 = ax.twinx()
ax2.plot(self.freq, self.power.imag, marker, color="g", alpha=0.5, label="Imaginary Part")
ax2.tick_params('y', colors="g")
and then
if labels is not None:
ax2.set_ylabel(labels[1])
else:
ax2.set_ylabel(f"Power ({self.norm})")
Or something on this line?
a096db4
to
320dd13
Compare
bb46275
to
34e1658
Compare
@mgullik the failures are unrelated to this PR |
Eliminates the annoying "imaginary" curve in Powerspectrum and other derivates of Crossspectrum that don't have one. Also, fixes the labels