Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Closed
Labels
Description
Hi, on the nbagg backend, blit doesn't seem to update without re-drawing. Here's a simple example:
importmatplotlib.pyplotaspltprev_artist=Nonecur_y=0.1defonclick_handle(event):"""Should draw elevating green line on each mouse click"""globalax,bg,prev_artist,cur_yax.figure.canvas.restore_region(bg)ifprev_artist:prev_artist.remove()cur_y+=0.1prev_artist=ax.plot([0,1], [cur_y,cur_y],'g')[0]ax.draw_artist(prev_artist)ax.figure.canvas.blit(ax.bbox)print"Drew line"ax=plt.gca()ax.plot([0,1], [0,1],'r')# ax.figure.canvas.draw()bg=ax.figure.canvas.copy_from_bbox(ax.bbox)ax.figure.canvas.mpl_connect('button_press_event',onclick_handle)
With%matplotlib nbagg, clicking on the plot doesn't cause any updates until the plot is re-drawn. With other backends (say qt) the plot updates immediately on clicking.
An unrelated oddity, if I uncomment the draw command and try re-drawing the figure just disappears (edit - on 1.4.3; seems fixed on 1.5.1dev1).
If it helps, IPython version is 2.3.0 and matplotlib is 1.4.3/1.5.1dev1; occurs on both chrome and firefox.UAT including animation example more or less run fine.
(Coincidental to the other nbagg animation issue just posted. Google led tothis post also.)