Separate "drawn" objects in Mathematica

What is the easiest / most convenient way to separate drawn objects in Mathematica from software generated ones?

Interactive drawing tools are convenient and useful. But if I draw something on top of the plot, it will be lost as soon as the plot is generated. Is there a convenient solution for this?

I could draw a drawing on top of an empty plot, they combine them with the actual plot. But this is again inconvenient, since I need to manually set the plot range of the empty section, and I do not see the background over which I add annotations.

+6
source share
2 answers

One approach using annotation for flag generated content:

Plot[Annotation[Sin[x], "GeneratedPrimitives"], {x, 0, 10}] RecoverDrawing[g_Graphics] := g /. Annotation[_, "GeneratedPrimitives"] :> {} RecoverDrawing[<modified graphic>] 

enter image description here

+14
source

Unfortunately, the best I can come up with is to write a program using ClickPane or EventHandler, which not only draws bu, writes the points added to the image. Code Modification:

 DynamicModule[{pts = {}}, ClickPane[Dynamic[ Framed@Graphics [Line[pts], PlotRange -> 1]], AppendTo[pts, #] &]] 
0
source

Source: https://habr.com/ru/post/898517/


All Articles