# Display/animate SVG files

**URL:** <https://discourse.jupyter.org/t/display-animate-svg-files/652>\
**Category:** General\
**Created:** [March 31, 2019, 5:43pm UTC](https://discourse.jupyter.org/t/display-animate-svg-files/652 "2019-03-31T17:43:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rheiland](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/rheiland/32/262_2.png) [@rheiland](https://discourse.jupyter.org/u/rheiland)\
**Post date:** [March 31, 2019, 5:43pm UTC](https://discourse.jupyter.org/t/display-animate-svg-files/652/1 "2019-03-31T17:43:23Z")

</div>

I’d like to display multiple SVG files, but overwriting previous, a la “ion” from matplotlib. Is this possible? e.g.:  
from IPython.display import SVG, display  
def show\_svg(frame\_idx):  
fname = ‘file:///path-to/file%d.svg’ % frame\_idx  
display(SVG(url=fname))

for idx in range(10):  
show\_svg(idx)

---

<div class="post-metadata">

**Author:** ![jhermann](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jhermann/32/257_2.png) [@jhermann](https://discourse.jupyter.org/u/jhermann)\
**Post date:** [March 31, 2019, 6:15pm UTC](https://discourse.jupyter.org/t/display-animate-svg-files/652/2 "2019-03-31T18:15:50Z")

</div>

IPython has a `clear_output` function.

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [April 1, 2019, 2:47pm UTC](https://discourse.jupyter.org/t/display-animate-svg-files/652/3 "2019-04-01T14:47:41Z")

</div>

Via _@story645 / Hannah_ on Twitter, I spotted this simple editor for creating simple SVG diagrams within a notebook: [https://github.com/uclmr/egal](https://github.com/uclmr/egal) .

It also claims to support the creation and replay of animated SVGs, but I couldn’t obviously find a way to enable the animation feature myself.
