From c8c47c084e5eaaac77228bf72e9dda3d9d834fd3 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 9 Jan 2023 12:31:29 -0500 Subject: [PATCH 1/2] Backport PR #24897: DOC: Add ref for every under examples/animation --- examples/animation/animate_decay.py | 2 ++ examples/animation/animated_histogram.py | 2 ++ examples/animation/animation_demo.py | 2 ++ examples/animation/bayes_update.py | 2 ++ examples/animation/double_pendulum.py | 2 ++ examples/animation/dynamic_image.py | 1 + examples/animation/frame_grabbing_sgskip.py | 2 ++ examples/animation/multiple_axes.py | 2 ++ examples/animation/pause_resume.py | 2 ++ examples/animation/rain.py | 2 ++ examples/animation/random_walk.py | 1 + examples/animation/simple_anim.py | 1 + examples/animation/simple_scatter.py | 1 + examples/animation/strip_chart.py | 2 ++ examples/animation/unchained.py | 2 ++ 15 files changed, 26 insertions(+) diff --git a/examples/animation/animate_decay.py b/examples/animation/animate_decay.py index 272fe46be43e..a96dd2a5952a 100644 --- a/examples/animation/animate_decay.py +++ b/examples/animation/animate_decay.py @@ -7,6 +7,8 @@ - using a generator to drive an animation, - changing axes limits during an animation. + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import itertools diff --git a/examples/animation/animated_histogram.py b/examples/animation/animated_histogram.py index 737d4c9a3833..254155b62a5e 100644 --- a/examples/animation/animated_histogram.py +++ b/examples/animation/animated_histogram.py @@ -45,6 +45,8 @@ def animate(frame_number): # ``prepare_animation`` will define ``animate`` function working with supplied # `.BarContainer`, all this is used to setup `.FuncAnimation`. +# Output generate via `matplotlib.animation.Animation.to_jshtml`. + fig, ax = plt.subplots() _, _, bar_container = ax.hist(data, HIST_BINS, lw=1, ec="yellow", fc="green", alpha=0.5) diff --git a/examples/animation/animation_demo.py b/examples/animation/animation_demo.py index ed88e2d9a418..d9d0225ebb00 100644 --- a/examples/animation/animation_demo.py +++ b/examples/animation/animation_demo.py @@ -10,6 +10,8 @@ examples that use it. Note that calling `time.sleep` instead of `~.pyplot.pause` would *not* work. + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import matplotlib.pyplot as plt diff --git a/examples/animation/bayes_update.py b/examples/animation/bayes_update.py index 6ac226d0d023..3874cef5aa9b 100644 --- a/examples/animation/bayes_update.py +++ b/examples/animation/bayes_update.py @@ -7,6 +7,8 @@ new data arrives. The vertical line represents the theoretical value to which the plotted distribution should converge. + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import math diff --git a/examples/animation/double_pendulum.py b/examples/animation/double_pendulum.py index fba7ea4ec9e2..6009245d12df 100644 --- a/examples/animation/double_pendulum.py +++ b/examples/animation/double_pendulum.py @@ -7,6 +7,8 @@ Double pendulum formula translated from the C code at http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ from numpy import sin, cos diff --git a/examples/animation/dynamic_image.py b/examples/animation/dynamic_image.py index cbec62607b2c..41bc7e54e908 100644 --- a/examples/animation/dynamic_image.py +++ b/examples/animation/dynamic_image.py @@ -3,6 +3,7 @@ Animated image using a precomputed list of images ================================================= +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/frame_grabbing_sgskip.py b/examples/animation/frame_grabbing_sgskip.py index e74576249aa0..1cdd47f0d70a 100644 --- a/examples/animation/frame_grabbing_sgskip.py +++ b/examples/animation/frame_grabbing_sgskip.py @@ -6,6 +6,8 @@ Use a MovieWriter directly to grab individual frames and write them to a file. This avoids any event loop integration, and thus works even with the Agg backend. This is not recommended for use in an interactive setting. + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/multiple_axes.py b/examples/animation/multiple_axes.py index ca75bea6169d..4a45aa28ea8c 100644 --- a/examples/animation/multiple_axes.py +++ b/examples/animation/multiple_axes.py @@ -7,6 +7,8 @@ - how animation across multiple subplots works, - using a figure artist in the animation. + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/pause_resume.py b/examples/animation/pause_resume.py index 7bed65140263..4f9dc3c39d99 100644 --- a/examples/animation/pause_resume.py +++ b/examples/animation/pause_resume.py @@ -15,6 +15,8 @@ You can copy and paste individual parts, or download the entire example using the link at the bottom of the page. + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import matplotlib.pyplot as plt diff --git a/examples/animation/rain.py b/examples/animation/rain.py index 9de510c41dfa..affa1d33867c 100644 --- a/examples/animation/rain.py +++ b/examples/animation/rain.py @@ -7,6 +7,8 @@ of 50 scatter points. Author: Nicolas P. Rougier + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/random_walk.py b/examples/animation/random_walk.py index f49c099a5c2d..e7e539f8884e 100644 --- a/examples/animation/random_walk.py +++ b/examples/animation/random_walk.py @@ -3,6 +3,7 @@ Animated 3D random walk ======================= +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/simple_anim.py b/examples/animation/simple_anim.py index 3bb3c4d952ba..4fe404521b7c 100644 --- a/examples/animation/simple_anim.py +++ b/examples/animation/simple_anim.py @@ -3,6 +3,7 @@ Animated line plot ================== +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/simple_scatter.py b/examples/animation/simple_scatter.py index 1d18039dcf11..c0bfa8bfa535 100644 --- a/examples/animation/simple_scatter.py +++ b/examples/animation/simple_scatter.py @@ -3,6 +3,7 @@ Animated scatter saved as GIF ============================= +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np import matplotlib.pyplot as plt diff --git a/examples/animation/strip_chart.py b/examples/animation/strip_chart.py index 9b6e814c66ef..77ea65b35fc2 100644 --- a/examples/animation/strip_chart.py +++ b/examples/animation/strip_chart.py @@ -4,6 +4,8 @@ ============ Emulates an oscilloscope. + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/unchained.py b/examples/animation/unchained.py index b242aeffd7ce..8a241ebfd61c 100644 --- a/examples/animation/unchained.py +++ b/examples/animation/unchained.py @@ -7,6 +7,8 @@ (mostly known because of the cover for Joy Division's Unknown Pleasures). Author: Nicolas P. Rougier + +Output generate via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np From 91f3bc4e23d61f2bb52c8427772c8c84284d12e0 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 11 Jan 2023 15:07:34 -0500 Subject: [PATCH 2/2] DOC: fix tense in documentation --- examples/animation/animate_decay.py | 2 +- examples/animation/animated_histogram.py | 2 +- examples/animation/animation_demo.py | 2 +- examples/animation/bayes_update.py | 2 +- examples/animation/double_pendulum.py | 2 +- examples/animation/dynamic_image.py | 2 +- examples/animation/frame_grabbing_sgskip.py | 2 +- examples/animation/multiple_axes.py | 2 +- examples/animation/pause_resume.py | 2 +- examples/animation/rain.py | 2 +- examples/animation/random_walk.py | 2 +- examples/animation/simple_anim.py | 2 +- examples/animation/simple_scatter.py | 2 +- examples/animation/strip_chart.py | 2 +- examples/animation/unchained.py | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/animation/animate_decay.py b/examples/animation/animate_decay.py index a96dd2a5952a..cfd95e4e5c29 100644 --- a/examples/animation/animate_decay.py +++ b/examples/animation/animate_decay.py @@ -8,7 +8,7 @@ - using a generator to drive an animation, - changing axes limits during an animation. -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import itertools diff --git a/examples/animation/animated_histogram.py b/examples/animation/animated_histogram.py index 254155b62a5e..3b242c4ce4cc 100644 --- a/examples/animation/animated_histogram.py +++ b/examples/animation/animated_histogram.py @@ -45,7 +45,7 @@ def animate(frame_number): # ``prepare_animation`` will define ``animate`` function working with supplied # `.BarContainer`, all this is used to setup `.FuncAnimation`. -# Output generate via `matplotlib.animation.Animation.to_jshtml`. +# Output generated via `matplotlib.animation.Animation.to_jshtml`. fig, ax = plt.subplots() _, _, bar_container = ax.hist(data, HIST_BINS, lw=1, diff --git a/examples/animation/animation_demo.py b/examples/animation/animation_demo.py index d9d0225ebb00..d2de7c43e7b5 100644 --- a/examples/animation/animation_demo.py +++ b/examples/animation/animation_demo.py @@ -11,7 +11,7 @@ Note that calling `time.sleep` instead of `~.pyplot.pause` would *not* work. -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import matplotlib.pyplot as plt diff --git a/examples/animation/bayes_update.py b/examples/animation/bayes_update.py index 3874cef5aa9b..1b56b74f656a 100644 --- a/examples/animation/bayes_update.py +++ b/examples/animation/bayes_update.py @@ -8,7 +8,7 @@ The vertical line represents the theoretical value to which the plotted distribution should converge. -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import math diff --git a/examples/animation/double_pendulum.py b/examples/animation/double_pendulum.py index 6009245d12df..8f055be79286 100644 --- a/examples/animation/double_pendulum.py +++ b/examples/animation/double_pendulum.py @@ -8,7 +8,7 @@ Double pendulum formula translated from the C code at http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ from numpy import sin, cos diff --git a/examples/animation/dynamic_image.py b/examples/animation/dynamic_image.py index 41bc7e54e908..d74e8bc8c1a9 100644 --- a/examples/animation/dynamic_image.py +++ b/examples/animation/dynamic_image.py @@ -3,7 +3,7 @@ Animated image using a precomputed list of images ================================================= -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/frame_grabbing_sgskip.py b/examples/animation/frame_grabbing_sgskip.py index 1cdd47f0d70a..3a3d5d39c04d 100644 --- a/examples/animation/frame_grabbing_sgskip.py +++ b/examples/animation/frame_grabbing_sgskip.py @@ -7,7 +7,7 @@ file. This avoids any event loop integration, and thus works even with the Agg backend. This is not recommended for use in an interactive setting. -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/multiple_axes.py b/examples/animation/multiple_axes.py index 4a45aa28ea8c..f3c246d151ac 100644 --- a/examples/animation/multiple_axes.py +++ b/examples/animation/multiple_axes.py @@ -8,7 +8,7 @@ - how animation across multiple subplots works, - using a figure artist in the animation. -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/pause_resume.py b/examples/animation/pause_resume.py index 4f9dc3c39d99..4d6f281a7e0f 100644 --- a/examples/animation/pause_resume.py +++ b/examples/animation/pause_resume.py @@ -16,7 +16,7 @@ You can copy and paste individual parts, or download the entire example using the link at the bottom of the page. -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import matplotlib.pyplot as plt diff --git a/examples/animation/rain.py b/examples/animation/rain.py index affa1d33867c..e5c2a467dbc0 100644 --- a/examples/animation/rain.py +++ b/examples/animation/rain.py @@ -8,7 +8,7 @@ Author: Nicolas P. Rougier -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/random_walk.py b/examples/animation/random_walk.py index e7e539f8884e..83cd530f6b42 100644 --- a/examples/animation/random_walk.py +++ b/examples/animation/random_walk.py @@ -3,7 +3,7 @@ Animated 3D random walk ======================= -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/simple_anim.py b/examples/animation/simple_anim.py index 4fe404521b7c..54480bc4ae6e 100644 --- a/examples/animation/simple_anim.py +++ b/examples/animation/simple_anim.py @@ -3,7 +3,7 @@ Animated line plot ================== -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/simple_scatter.py b/examples/animation/simple_scatter.py index c0bfa8bfa535..a0583c81e740 100644 --- a/examples/animation/simple_scatter.py +++ b/examples/animation/simple_scatter.py @@ -3,7 +3,7 @@ Animated scatter saved as GIF ============================= -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np import matplotlib.pyplot as plt diff --git a/examples/animation/strip_chart.py b/examples/animation/strip_chart.py index 77ea65b35fc2..9467ed3249b5 100644 --- a/examples/animation/strip_chart.py +++ b/examples/animation/strip_chart.py @@ -5,7 +5,7 @@ Emulates an oscilloscope. -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np diff --git a/examples/animation/unchained.py b/examples/animation/unchained.py index 8a241ebfd61c..3915f55dedd4 100644 --- a/examples/animation/unchained.py +++ b/examples/animation/unchained.py @@ -8,7 +8,7 @@ Author: Nicolas P. Rougier -Output generate via `matplotlib.animation.Animation.to_jshtml`. +Output generated via `matplotlib.animation.Animation.to_jshtml`. """ import numpy as np