I have a function which is very expensive to run. I would like to Plot the function for a certain range, but it is time prohibitive to let Plot simply compute the function for a lot of values as it sees fit.
Instead, I am calling the function for a range of values, and then calling ListPlot with the {x,y} pairs produced. However, I would like to refine the Plot by calling the function more times for areas of interest and then updating the ListPlot. I am unsure what the best way to do this is, or in fact how to do it at all.
My first thought was to create a SparseArray, and then I could fill in more values as they are calculated. But SpareArray requires an integer index, and my x values are real. I also can't use memoization because I need a quick and easy way to spit out all the {x,y} values I have computed so far, and I don't think there's an easy way to get this from a list of manual f[x]=y assignments.