Hello, I have a pcolormesh() plot that I would like to update when a user presses a key. Basically there are data files from 0..N and I want to update the plot to the next frame when a user presses the 'right' arrow. I have the keypress event working, I just don't know how to 'update' the data for the pcolormesh.
I'm pretty new to matplotlib, so if anyone could help with this it would be greatly appreciated! Thanks! (Code snippet below) def press(event): if event.key=='right': data2D = readDataFile() #updates data2D #update pcolormesh somehow?? fig.canvas.draw() #X,Y,data2D are initially set here... fig = plt.figure() fig.canvas.mpl_connect('key_press_event', press) ax = fig.add_subplot(111) plt.pcolormesh(X, Y, data2D) plt.colorbar() -- View this message in context: http://old.nabble.com/How-to-update-pcolormesh-data---update-plot--tp31913409p31913409.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users