-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
DOC: Use Sphinx-gallery animation capture #17477
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
Changes from 2 commits
aaa9cc1
0d82faf
1df45d6
0a4dd1c
4780a81
de0fb17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,10 +189,6 @@ div.documentwrapper { | |
| } | ||
| */ | ||
|
|
||
| div.clearer { | ||
| clear: both; | ||
| } | ||
|
|
||
| div.related h3 { | ||
| display: none; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -39,7 +39,7 @@ def update(self, y): | |||||
| return self.line, | ||||||
|
|
||||||
|
|
||||||
| def emitter(p=0.03): | ||||||
| def emitter(p=0.1): | ||||||
| """Return a random value in [0, 1) with probability p, else 0.""" | ||||||
| while True: | ||||||
| v = np.random.rand(1) | ||||||
|
|
@@ -49,14 +49,14 @@ def emitter(p=0.03): | |||||
| yield np.random.rand(1) | ||||||
|
|
||||||
| # Fixing random state for reproducibility | ||||||
| np.random.seed(19680801) | ||||||
| np.random.seed(1968080) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
One of the sentimental things we do is seed the random numbers to John Hunter's birthday. Would rather not change this unless there is a compelling reason.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was intentional -- the original seed did not yield many spikes for the given probability (and increasing the probability further made too many spikes) over the first few seconds of the animation
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about I write it as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Or I could test if 0 or
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Could also "prime" the stream a bit by generating and discarding a bunch of numbers?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed the |
||||||
|
|
||||||
|
|
||||||
| fig, ax = plt.subplots() | ||||||
| scope = Scope(ax) | ||||||
|
|
||||||
| # pass a generator in "emitter" to produce data for the update func | ||||||
| ani = animation.FuncAnimation(fig, scope.update, emitter, interval=10, | ||||||
| ani = animation.FuncAnimation(fig, scope.update, emitter, interval=50, | ||||||
| blit=True) | ||||||
|
|
||||||
| plt.show() | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,5 +12,6 @@ colorspacious | |
| ipython | ||
| ipywidgets | ||
| numpydoc>=0.8 | ||
| sphinx-gallery>=0.5 | ||
| sphinx-gallery>=0.7 | ||
| sphinx-copybutton | ||
| scipy | ||
Uh oh!
There was an error while loading. Please reload this page.