Skip to main content

Dynamic matplotlib plots in Jupyter notebooks

Project description

dyn_plot

Create matplotlib figures that can be easily updated at runtime in Jupyter.

import numpy as np
from dyn_plot import Plot

# accepts all plt.figure() arguments
plot = Plot(figsize=(10, 5))

ts = np.linspace(0, 10, 200)
losses = []
for t in ts:
  loss = -np.log(t + 0.001) + np.random.normal() * 0.4
  losses.append(loss)

  with plot: # clear and redraw
    # use any methods from Axes
    plot.set_title(f't = {t:.2f}')
    plot.plot(losses)

# close to avoid an additional rendering of the inner figure
plot.close() 

dyn plot video

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

dyn_plot-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

dyn_plot-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file dyn_plot-0.1.1.tar.gz.

File metadata

  • Download URL: dyn_plot-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Darwin/23.5.0

File hashes

Hashes for dyn_plot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1eb4c0fe230fd33377419fea4c0a1213a00fc607dd621383cf3a1b91abd28e26
MD5 d14a692dea9adfcf5116395d25e139d5
BLAKE2b-256 efb23d805ab0f359e1825a18b5e183bf4073ca26351a28d2ffa12769b3a94afb

See more details on using hashes here.

File details

Details for the file dyn_plot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dyn_plot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Darwin/23.5.0

File hashes

Hashes for dyn_plot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 151d0d9491a06c7d0afcc0b94684a1792324a66c3cbfe088e5db6065250c8337
MD5 0b1889e9bd3a2d613085a1ed191339cb
BLAKE2b-256 76c3a57ba33780d75d919418a5dde486c17670b18cb30054acc0a28d71de1c46

See more details on using hashes here.

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