8000 Fix cohere-demo by dstansby · Pull Request #7968 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix cohere-demo #7968

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

Merged
merged 5 commits into from
Feb 8, 2017
Merged

Fix cohere-demo #7968

merged 5 commits into from
Feb 8, 2017

Conversation

dstansby
Copy link
Member

See http://matplotlib.org/devdocs/_images/cohere_demo1.png for current image

  • Fixed hidden x-axis label on top plot
  • Fixed hidded y-axis label on top plot
  • Everybody loves plt.subplots!

Copy link
Member
@NelleV NelleV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dstansby
When you do work on the examples, can you make sure they follow our new standards?
In particular, concerning their documentation:
http://matplotlib.org/devdocs/devel/MEP/MEP12.html#clean-up-guidelines

@NelleV NelleV changed the title Fix cohere-demo [MRG+1] Fix cohere-demo Jan 28, 2017
@NelleV NelleV changed the title [MRG+1] Fix cohere-demo Fix cohere-demo Jan 28, 2017
@dstansby
Copy link
Member Author

Woops, hadn't come across those new standards before! Should be good now,

@NelleV NelleV changed the title Fix cohere-demo [MRG+1] Fix cohere-demo Jan 29, 2017
r = np.exp(-t / 0.05)

cnse1 = np.convolve(nse1, r, mode='same') * dt # colored noise 1
cnse2 = np.convolve(nse2, r, mode='same') * dt # colored noise 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure what this "colored noise" means, but something is wrong here. If you don't limit the x-axis, you can see that past 15s, the noise is nearly zero. It works better if you use full mode and truncate the result:

cnse1 = np.convolve(nse1, r)[:len(t)] * dt   # colored noise 1
cnse2 = np.convolve(nse2, r)[:len(t)] * dt   # colored noise 2 

@dstansby
Copy link
Member Author
dstansby commented Feb 8, 2017

I have removed the convolution completely from the example, since I'm not sure it adds anything. Now it still shows that the coherence peaks at 10Hz, which is the coherent bit of the two signals.

@dopplershift dopplershift merged commit e6e8468 into matplotlib:master Feb 8, 2017
@dopplershift dopplershift changed the title [MRG+1] Fix cohere-demo Fix cohere-demo Feb 8, 2017
@dstansby dstansby deleted the cohere-demo-fix branch February 9, 2017 09:52
@QuLogic QuLogic added this to the v2.1 milestone Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0