Multiple redraws in qt4 backend

I was checking the performance of the GtkAgg and Qt4Agg backends and noticed that the Qt4Agg backend calls canvas.draw 3 times for every pylab.show()

The three calls are:

backend_qt4.py::65

manager.window.show()->resizeEvent->draw

backend_qt4.py::71

figManager.canvas.draw()

backend_qtagg4.py::69

FigureCanvasQTAgg.paintEvent -> FigureCanvasAgg.draw(self)

show() in backend_qt4.py includes the extra call to figManager.canvas.draw compared to the gtk backend. It doesn’t seem to be necessary.

There is a ‘replot’ flag in the canvas.draw function in FigureCanvasQTAgg which looks as though it should be True in order to prevent the extra draw in paintEvent.

John

What mpl version are you using?

···

On Tue, Sep 7, 2010 at 10:09 AM, John Porter <jporter@...884...> wrote:

I was checking the performance of the GtkAgg and Qt4Agg backends and noticed
that the Qt4Agg backend calls canvas.draw 3 times for every pylab.show()
The three calls are:
backend_qt4.py::65
manager.window.show()->resizeEvent->draw
backend_qt4.py::71
figManager.canvas.draw()
backend_qtagg4.py::69
FigureCanvasQTAgg.paintEvent -> FigureCanvasAgg.draw(self)
show() in backend_qt4.py includes the extra call to figManager.canvas.draw
compared to the gtk backend. It doesn't seem to be necessary.
There is a 'replot' flag in the canvas.draw function in FigureCanvasQTAgg
which looks as though it should be True in order to prevent the extra draw
in paintEvent.