Would like to update visible plot using pyside and matplotlib

I have a tool to show information extracted from various experiments and then
stored in a database. I would like to update a plot shown in the lower half
of the window when information such as the ranges of variables are modified
in the upper half. I can initially put data into the plot, however when I
want to change the contents (such as add another line to the plot), the
changes don't get displayed. Here is some code to illustrate the problem:

import matplotlib
matplotlib.rcParams['backend.qt4'] = 'PySide'
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
from PySide import QtCore, QtGui
import sys

class TabDialog(QtGui.QDialog):
   def __init__(self):
      super(TabDialog, self).__init__()

      tabWidget = QtGui.QTabWidget()
      tabWidget.addTab(AnalyzeTab(), self.tr("Analyze"))

      buttonLayout = QtGui.QHBoxLayout()
      saveButton = QtGui.QPushButton(self.tr("Update"))

      mainLayout = QtGui.QVBoxLayout()

   def update(self):

class DataHolder():
   def __init__(self):
      self.gFig = Figure()
      self.ax = self.gFig.add_subplot(111)
      self.canvas = FigureCanvas(self.gFig)

   def update(self):

class AnalyzeTab(QtGui.QWidget):
   def __init__(self, parent=None):
      QtGui.QWidget.__init__(self, parent)

      analyzeLayout = QtGui.QGridLayout()
      analyzeLayout.addWidget(data.canvas, 2, 0, 6, 8)


if __name__ == "__main__":
   app = QtGui.QApplication(sys.argv)

   data = DataHolder()

   tabdialog = TabDialog()

Any suggestions are very much appreciated.


View this message in context: http://matplotlib.1069221.n5.nabble.com/Would-like-to-update-visible-plot-using-pyside-and-matplotlib-tp39576.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I figured out the problem. I need to call self.canvas.draw() in order to
update the image. Sorry for the email.


View this message in context: http://matplotlib.1069221.n5.nabble.com/Would-like-to-update-visible-plot-using-pyside-and-matplotlib-tp39576p39577.html
Sent from the matplotlib - users mailing list archive at Nabble.com.