The plot()
function does Two Things:
- takes your function and samples its values (somewhat intelligently) to create a list of 2D coordinate pairs
- uses that list of coordinates to create a plot object
Is there a way to decouple these steps, i.e. separately invoke the logic of step 1 to obtain a list of 2D points and then the logic of step 2 to obtain the plot object?
The motivation for this is computing different curves of a composite plot on different cores using @parallel
. Very unfortunately the return value of plot(), whatever it is, doesn't pickle/unpickle properly, and thus cannot be returned between threads. So if you generate separate plot objects in your @parallel
function, all you will get at the call point will be an iterator yielding error messages. This could be avoided if I could _just_ compute the 2D data lists in threads, and "render" them to plots in the main thread.
Is that doable?
Please be aware that I am interested in using plot()
's actual logic for sampling the plotted function, rather than writing my own logic that would probably be inferior.