What is the simplest / most convenient way to separate hand-drawn objects in Mathematica from programmatically generated ones?
The interactive drawing tools are convenient and useful. But if I draw something on top of the plot, it will get lost as soon as the plot is re-generated. Is there a convenient solution for this?
I could make the drawing on top of an empty plot, them combine them with the actual plot. But this is again inconvenient as I need to manually set the plot range of the empty plot and I don't see the background on top of which I'm adding the annotations.
One approach, using an annotation to flag the generated content:
Plot[Annotation[Sin[x], "GeneratedPrimitives"], {x, 0, 10}]
RecoverDrawing[g_Graphics] := g /. Annotation[_, "GeneratedPrimitives"] :> {}
RecoverDrawing[<modified graphic>]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With