From: Robert P. <rob...@jk...> - 2008-12-09 09:31:03
|
Hello Werner, I am just trying to clear a plot to prepare plotting of a modified diagram. How is this done? When I try it as follows, the plot window is not cleared, and the new title text superimposes the old one instead. Best regards, Robert --- examples/c++/wxPLplotDemo.cpp (revision 8888) +++ examples/c++/wxPLplotDemo.cpp (working copy) @@ -205,4 +205,10 @@ { wxMessageBox( _T("This is the About dialog of the wxPLplot demo.\n"), _T("About wxPLplot"), wxOK | wxICON_INFORMATION, this ); + + wxPLplotstream* pls=plotwindow->GetStream(); + + pls->clear(); + pls->lab( "x", "y", "An Empty Plot" ); + plotwindow->RenewPlot(); } |
From: Werner S. <sm...@ia...> - 2008-12-09 13:09:24
|
Hi Robert, I can duplicate this bug/feature here on Mac OS X with the latest PLplot revision. You could use pls->adv(0); instead of the clear(); statement. This will clear the plot, since a new one is started. I have to to look at the clear function in plplot what is supposed to happen. Regards, Werner On 09.12.2008, at 10:28, Robert Pollak wrote: > Hello Werner, > > I am just trying to clear a plot to prepare plotting of a modified > diagram. > > How is this done? When I try it as follows, the plot window is not > cleared, and the new title text superimposes the old one instead. > > Best regards, > Robert > > > --- examples/c++/wxPLplotDemo.cpp (revision 8888) > +++ examples/c++/wxPLplotDemo.cpp (working copy) > @@ -205,4 +205,10 @@ > { > wxMessageBox( _T("This is the About dialog of the wxPLplot demo. > \n"), > _T("About wxPLplot"), > wxOK | wxICON_INFORMATION, this ); > + > + wxPLplotstream* pls=plotwindow->GetStream(); > + > + pls->clear(); > + pls->lab( "x", "y", "An Empty Plot" ); > + plotwindow->RenewPlot(); > } -- Dr. Werner Smekal Institut fuer Allgemeine Physik Technische Universitaet Wien Wiedner Hauptstr 8-10 A-1040 Wien Austria email: sm...@ia... web: http://www.iap.tuwien.ac.at/~smekal phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory) fax: +43-(0)1-58801-13499 |
From: Robert P. <rob...@jk...> - 2008-12-09 14:19:00
|
Werner Smekal wrote: > You could use > > pls->adv(0); > > instead of the clear(); statement. This will clear the plot, since a new > one is started. Yes, thank you, this switching to a new page clears the plot window - but the growing memory consumption indicates that the content of the original page still exists. --Robert |
From: Werner S. <sm...@ia...> - 2008-12-10 08:49:37
|
Hi Robert, > > Yes, thank you, this switching to a new page clears the plot window - > but the growing memory consumption indicates that the content of the > original page still exists. I fixed the problem now, the page is cleared now if you use plclear() and do a consecutive replot/remake. This was actually not a problem of the wxWidgets driver, but of the plot buffer (which took me a while to sort out). Anyway, this solution might also be not optimal since the plot buffer is not cleared - if you replot the whole (old) plot will be plotted which is cleared at the end :). But I also did some other improvements, so you might try out the latest svn revision. One solution would be to clear the plot buffer for such a command, but this is problematic, since not everything should be cleared I think, this has to be checked and tested. On the other hand it may be better to stick with pladv(0) and sort out the increasing memory consumption. At least plcear() does now what it should do even if it does it not "optimal". Thanks for the report. Regards, Werner -- Dr. Werner Smekal Institut fuer Allgemeine Physik Technische Universitaet Wien Wiedner Hauptstr 8-10 A-1040 Wien Austria email: sm...@ia... web: http://www.iap.tuwien.ac.at/~smekal phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory) fax: +43-(0)1-58801-13499 |
From: Robert P. <rob...@jk...> - 2009-03-30 08:55:19
|
Hello Werner, in a December thread, you helped me with clearing a wxPLplotwindow. The remaining issue was, that in either solution (pladv(0) and plclear()) the plot buffer is not cleared, and therefore more and more memory is consumed with each replot. Since I now have to update a plot very often and over long time, let me ask whether the plot buffer can be cleared to avoid the memory hogging, short of deleting/recreating the wxPLplotwindow. Best Regards, Robert |