python - Graphs not updating (matplotlib) -


i'm trying make gui contains several figures, each axes (is 'axes' plural?). managed leftmost graph plot upon initializing respective widget using line:

    self.leftimage = self.leftplot.axes.imshow(self.defaultslide, cmap = self.mymap) 

where self.leftplot contains necessary figure properties. noticed didn't have call plt.show() or variants part, don't know whether it's significant or not.

later in code, called self.leftimage.set_data(newslide), nothing seems change though gets executed. tried setting leftimage new instance of imshow(), doesn't seem fix anything.

my imports:

from pyside import qtcore, qtgui pyside.qtcore import * pyside.qtgui import * import matplotlib  matplotlib.use('qt4agg') matplotlib.rcparams['backend.qt4']='pyside'  matplotlib.figure import figure matplotlib.backends.backend_qt4agg import figurecanvasqtagg figurecanvas matplotlib.backends.backend_qt4agg import navigationtoolbar2qtagg navigationtoolbar import matplotlib.pyplot plt 

i'm new matplotlib, come matlab background if helps.

you should use draw() after update (done set_data()).

see related post detail https://stackoverflow.com/a/17837600/4716013


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -