Skip to content

Commit

Permalink
Change to_html5_video() to to_jshtml()
Browse files Browse the repository at this point in the history
  • Loading branch information
narahahn committed Mar 13, 2019
1 parent a30f08f commit d8a5f0e
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions doc/examples/animations-pulsating-sphere.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,22 @@
"ani = animation.particle_displacement(\n",
" omega, center, radius, amplitude, grid, frames, figsize, c='Gray')\n",
"plt.close()\n",
"HTML(ani.to_html5_video())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can play with the animation more interactively by using `.to_jshtml`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"HTML(ani.to_jshtml())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Click the arrow button to start the animation.\n",
"`to_jshtml()` allows you to play with the animation,\n",
"e.g. speed up/down the animation (+/- button).\n",
"Try to reverse the playback by clicking the left arrow.\n",
"You'll see a sound _sink_.\n",
"\n",
"You can also show the animation by using `to_html5_video()`.\n",
"See the [documentation](https://matplotlib.org/api/_as_gen/matplotlib.animation.ArtistAnimation.html#matplotlib.animation.ArtistAnimation.to_html5_video) for more detail.\n",
"\n",
"Of course, different types of grid can be chosen.\n",
"Below is the particle animation using the same parameters\n",
"but with a [hexagonal grid](https://www.redblobgames.com/grids/hexagons/)."
Expand Down Expand Up @@ -158,7 +151,7 @@
"ani = animation.particle_displacement(\n",
" omega, center, radius, amplitude, grid, frames, figsize, c='Gray')\n",
"plt.close()\n",
"HTML(ani.to_html5_video())"
"HTML(ani.to_jshtml())"
]
},
{
Expand All @@ -179,7 +172,7 @@
"ani = animation.particle_displacement(\n",
" omega, center, radius, amplitude, grid, frames, figsize, c='Gray')\n",
"plt.close()\n",
"HTML(ani.to_html5_video())"
"HTML(ani.to_jshtml())"
]
},
{
Expand Down Expand Up @@ -208,7 +201,7 @@
"ani = animation.particle_velocity(\n",
" omega, center, radius, amplitude, grid, frames, figsize)\n",
"plt.close()\n",
"HTML(ani.to_html5_video())"
"HTML(ani.to_jshtml())"
]
},
{
Expand Down Expand Up @@ -254,7 +247,7 @@
" omega, center, radius, amplitude, grid, frames, pulsate=True,\n",
" figsize=figsize, vmin=-max_pressure, vmax=max_pressure)\n",
"plt.close()\n",
"HTML(ani.to_html5_video())"
"HTML(ani.to_jshtml())"
]
},
{
Expand Down Expand Up @@ -296,7 +289,7 @@
" omega, center, radius, amplitude, grid, frames, pulsate=True,\n",
" figsize=figsize, vmin=-max_pressure, vmax=max_pressure)\n",
"plt.close()\n",
"HTML(ani.to_html5_video())"
"HTML(ani.to_jshtml())"
]
},
{
Expand Down Expand Up @@ -328,7 +321,7 @@
" omega, center, radius, amplitude, grid, frames, pulsate=True,\n",
" figsize=figsize, vmin=-max_pressure, vmax=max_pressure)\n",
"plt.close()\n",
"HTML(ani.to_html5_video())"
"HTML(ani.to_jshtml())"
]
},
{
Expand Down

0 comments on commit d8a5f0e

Please sign in to comment.