<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">ok :-)<div><br></div><div>i find a solution .. maybe correct :</div><div><br></div><div>in the  __init__ i added :</div><div><br></div><div>self.a = None</div><div><br></div><div><br></div><div>then in "on_draw" :</div><div><br></div><div><div>if self.a is not None:</div><div><span class="Apple-tab-span" style="white-space:pre">                     </span>self.axes.collections.remove(self.a)</div></div><div><br></div><div>self.a = self.axes.plot_surface(x, y, z, rstride=res, cstride=res, facecolors=colors)</div><div><br></div><div><br></div><div>now the plot is refreshed ok :-)</div><div><br></div><div><br></div><div><br><div><div>Il giorno 08/feb/2011, alle ore 10.35, Massimo Di Stefano ha scritto:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px; ">hello All
</span><span class="Apple-style-span" style="font-size: 12px; "><br></span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">have you never tried to embed a matplotlib 3d graph inside pyqt ?</span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">
i'm tring to do it .. but i've problenms to refresh my plot.</span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">
The 3d data are displayed ok inside a pyqt simple widget, </span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">but if i try to redraw the image (re-call the on_draw function) ...  </span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">i have it overlay the previouse one.</span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">If i add "clear()" at begin of my "on_draw" action, </span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">the plot is update correctly ... and each "on_draw" action give me the correct results ...  </span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">but then i'm no more able to move the 3d plot view (but i can only zoom in/out the scene)</span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;"></span></font><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">the code i'm using is : <a href="http://paste.debian.net/106890">http://paste.debian.net/106890</a></span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "></span><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">at line 22 there is a "def erase(self):" function</span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">if i connect it to the plot i have the image is correctly redraw .. but then i lost the 3d actions </span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;">can you give it a try ?</span></font></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "><br></span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><font class="Apple-style-span" face="Arial" size="3"><span class="Apple-style-span" style="font-size: 12px;"></span></font><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">seems thast the "clear()" action broke something ... thanks a lot for any help</span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "></span><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">to try it .. i've upload the .mat file (just few kbytes)</span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "></span><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">it is available at : </span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "><br></span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "><a href="http://www.geofemengineering.it/data/complexity_depth_grid1.mat">http://www.geofemengineering.it/data/complexity_depth_grid1.mat</a></span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "><br></span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "><br></span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">Thank you!</span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; "><br></span></pre><pre style="word-wrap: break-word; white-space: pre-wrap;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; ">Massimo.</span></pre><div><br></div></div>_______________________________________________<br>PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br><a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></blockquote></div><br></div></body></html>