Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Use broader def of Animation #693

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 2 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
steps:
# Get our data and merge with upstream
- run: sudo apt-get update
- run: sudo apt-get --no-install-recommends install -y texlive texlive-latex-extra latexmk libxkbcommon-x11-0
- run: sudo apt-get --no-install-recommends install -y texlive texlive-latex-extra latexmk libxkbcommon-x11-0 optipng
- checkout
- run: echo $(git log -1 --pretty=%B) | tee gitlog.txt
- run: echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt
Expand Down
2 changes: 1 addition & 1 deletion doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ to scrape both matplotlib and Mayavi images you can do::
The default value is ``'image_scrapers': ('matplotlib',)`` which only scrapes
Matplotlib images. Note that this includes any images produced by packages that
are based on Matplotlib, for example Seaborn or Yellowbrick. If you want
to embed :class:`matplotlib.animation.FuncAnimation`\s as animations rather
to embed :class:`matplotlib.animation.Animation`\s as animations rather
than a single static image of the animation figure, you should add::

sphinx_gallery_conf = {
Expand Down
4 changes: 2 additions & 2 deletions sphinx_gallery/scrapers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ def matplotlib_scraper(block, block_vars, gallery_conf, **kwargs):
the images. This is often produced by :func:`figure_rst`.
"""
matplotlib, plt = _import_matplotlib()
from matplotlib.animation import FuncAnimation
from matplotlib.animation import Animation
image_path_iterator = block_vars['image_path_iterator']
image_rsts = []
# Check for animations
anims = list()
if gallery_conf.get('matplotlib_animations', False):
for ani in block_vars['example_globals'].values():
if isinstance(ani, FuncAnimation):
if isinstance(ani, Animation):
anims.append(ani)
# Then standard images
for fig_num, image_path in zip(plt.get_fignums(), image_path_iterator):
Expand Down