When plotting a slow function, it would be nice to know how much of the work has already be done. However due to the refinement algorithm, simply monitoring the integration variable doesn't give an useful estimate unless MaxRecursion
is set to 0 (and it's clear that the best I can hope for is an estimate). For example, consider
Monitor[Plot[Pause[0.01];Sin[x],{x,0,100}],x]
This goes through the interval dozens of times, although the number of points in each iteration goes down.
Therefore my question: Is there any way to get a reasonable estimate of how much of a plot is already done?
Plot
uses, or is it an alternative sampling algorithm to be used instead for a self-writtenPlot
replacement? $\endgroup$Plot
should use either the same or a very similar algorithm, with a threshold angle of 5 degrees. It will refine the sampling grid if the angle between tho consecutive line segments exceeds 5 degrees. (The code is mine, I didn't take it fromPlot
) $\endgroup$Graphics`Spline`
featured a set of subroutines that were essentially explicit reimplementations of the algorithm used withinPlot[]
/ParametricPlot[]
. You might wish to take a look at them. $\endgroup$