[PyQt] refresh 3dplot

Massimo Di Stefano massimodisasha at gmail.com
Tue Feb 8 19:59:22 GMT 2011


ok :-)

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 :-)



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
> 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
> 
> 
> Thank you!
> 
> Massimo.
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110208/af765778/attachment-0001.html>


More information about the PyQt mailing list