Skip to main content

Add animations to revealjs presentations from Python code-blocks.

Project description

PyFragments

Add animated figures to your Quarto presentations.

Install

pip install pyfragments

Example

A Revealjs presentation created with Quarto, which displays an animated matplotlib figure:

Animated figure

This is created with the following code, in a Quarto .qmd file.

---
format: revealjs
---

## Example of an animated figure

Move to the next slide to see the transitions.

```{python}
# | output: asis
import matplotlib.pyplot as plt
from pyfragments import AnimatedFigure

with AnimatedFigure() as ani:
    plt.xlim(0, 10)
    plt.ylim(0, 10)
    for i in range(10):
        with ani.fragment():
            plt.scatter(i, i)

```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfragments-0.3.0.tar.gz (48.6 kB view hashes)

Uploaded Source

Built Distribution

pyfragments-0.3.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page