refresh 3dplot

hello All

have you never tried to embed a matplotlib 3d graph inside pyqt ?

i'm tring to do it .. but i've problenms to refresh my plot.

The 3d data are displayed ok inside a pyqt simple widget, 
but if i try to redraw the image (re-call the on_draw function) ...  
i have it overlay the previouse one.

If i add "clear()" at begin of my "on_draw" action, 
the plot is update correctly ... and each "on_draw" action give me the correct results ...  
but then i'm no more able to move the 3d plot view (but i can only zoom in/out the scene)
the code i'm using is : [http://paste.debian.net/106890](http://paste.debian.net/106890)
at line 22 there is a "def erase(self):" function
if i connect it to the plot i have the image is correctly redraw .. but then i lost the 3d actions
can you give it a try ?

seems thast the "clear()" action broke something ... thanks a lot for any help
to try it .. i've upload the .mat file (just few kbytes)
it is available at : 

[http://www.geofemengineering.it/data/complexity_depth_grid1.mat](http://www.geofemengineering.it/data/complexity_depth_grid1.mat)


Thank you!

Massimo.

ok :slight_smile:

i find a solution … maybe correct :

in the init i added :

self.a = None

then in “on_draw” :

if self.a is not None:

		self.axes.collections.remove(self.a)

self.a = self.axes.plot_surface(x, y, z, rstride=res, cstride=res, facecolors=colors)

now the plot is refreshed ok :slight_smile:

···

Il giorno 08/feb/2011, alle ore 10.35, Massimo Di Stefano ha scritto:

hello All


have you never tried to embed a matplotlib 3d graph inside pyqt ?

i'm tring to do it .. but i've problenms to refresh my plot.

The 3d data are displayed ok inside a pyqt simple widget, 
but if i try to redraw the image (re-call the on_draw function) ...  
i have it overlay the previouse one.


If i add "clear()" at begin of my "on_draw" action, 
the plot is update correctly ... and each "on_draw" action give me the correct results ...  
but then i'm no more able to move the 3d plot view (but i can only zoom in/out the scene)
the code i'm using is : [http://paste.debian.net/106890](http://paste.debian.net/106890)
at line 22 there is a "def erase(self):" function
if i connect it to the plot i have the image is correctly redraw .. but then i lost the 3d actions
can you give it a try ?


seems thast the "clear()" action broke something ... thanks a lot for any help
to try it .. i've upload the .mat file (just few kbytes)
it is available at : 


[http://www.geofemengineering.it/data/complexity_depth_grid1.mat](http://www.geofemengineering.it/data/complexity_depth_grid1.mat)




Thank you!


Massimo.

PyQt mailing list PyQt@…2120…
http://www.riverbankcomputing.com/mailman/listinfo/pyqt