kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
230 stars 37 forks source link

Display into an existing cell should retain its size #322

Open kpeeters opened 2 weeks ago

kpeeters commented 2 weeks ago

When updating a plot dynamically, as in the example below, the size of the image should be kept at the size set by the user. Do not replace with the standard size on every frame.

from cdb.graphics.plot import *
import numpy as np
import time
out=0
for i in np.linspace(1.0, 4.0, 100):
   out=display(plot($\sin( @(i)*x )\cos(2 x)$, ($x$, -6.28, 6.28), samples=300, grid=True), out)
   time.sleep(0.01)