Page 1 of 1

PostponeRedraw

Posted: Thu Sep 24, 2015 4:29 am
by Bercic
Dear Mr. David,

I am trying to prevent that Dplot redraw plot after addition of each new curve by using PostponeRedraw() command. Please could you advice me how to correct the following code in order to get desired effect or describe where PostponeRedraw command should be placed in order to prevent intermediate redrawing?

FOR j=curvestart TO curveend
count=count+1
ret=DPlot_Command(DocNum, "[PostponeRedraw()][SelectCurve(" & STR$(j)& ")][MultipleYAxes(0,0,0)]")
ret = DPlot_AddData( DocNum, %DATA_XYXY, yalldata,J,xdata(1),dataLeft(1+yalldata*(count-1)))
DocNum=ret
NEXT

Best regards, Gorazd

Posted: Thu Sep 24, 2015 10:08 am
by DPlotAdmin
Unfortunately PostponeRedraw doesn't do anything with DPlot_AddData. But since you apparently don't want the plot updated until you're done, this should work:

Code: Select all

ret=DPlot_Command(0,"[AppHide()]")
FOR j=curvestart TO curveend 
count=count+1 
ret = DPlot_AddData( DocNum, %DATA_XYXY, yalldata,J,xdata(1),dataLeft(1+yalldata*(count-1))) 
DocNum=ret 
NEXT 
ret=DPlot_Command(0,"[AppShow()]")
Unless you're plotting 100's of thousands of points, DPlot won't actually have time to hide itself. But the plot won't be updated and you should see a significant increase in performance.

Posted: Thu Sep 24, 2015 2:58 pm
by Bercic
Dear David thanks for prompt response and useful information about the way how to temporary prevent »flashing« of DPlot window.

Gorazd - frequent DPlot user. I use DPlot daily for quick analysis and presentation of experimental and simulated data.