Interactive plot in Jupyter notebook
<p>I am trying to get 'realtime' ploting in Jupyter notebook.
The example can be found <a href="http://nbviewer.jupyter.org/url/jointlab.upol.cz/machulka/download/_tmp/matplotlib.ipynb" rel="noreferrer">here</a>. Here is the code:</p>

<pre><code>%matplotlib notebook

import numpy as np
import matplotlib.pyplot as pl

from random import randint
from time import sleep

from ipywidgets import FloatProgress
from IPython import display

siz = 10
dat = np.zeros((siz, siz))

fig = pl.figure()
axe = fig.add_subplot(111)
img = axe.imshow(dat)

num = 1000

prgBar = FloatProgress(min=0, max=num-1)
display.display(prgBar)

for i in range(num):
    prgBar.value = i
    pos = (randint(0, siz-1), randint(0, siz-1))
    dat[pos] += 1
    img.set_data(dat)
    img.autoscale()
    #sleep(0.01)
</code></pre>

<p>What I am aiming for is to see how the plot is changing with each itteration.
I also tried set the interactive mod on by pl.ion(), changing backent to inline, calling pl.draw(), but non of it was working. BTW, the progressbar is working just fine...</p>

<p>Thanks Radek</p>