Code from drawings

After drawing with the Control D tool, can I recover Mathematica code for my drawing? Otherwise, I have to cut and paste a matrix full of graphic elements into these axes and labels I have drawn. This is a repetitive process producing many similar matrices all with the same set of axes.

Don’t use the figure! Full of mutations.

Yes. After you have created your graphic using the drawing tools, assign the graphic to a parameter, say myGraph by typing myGraph in front of it:

then execute the cell. In a separate cell execute

InputForm[graph]

and you will get the code for myGraph. E.g.:

In[2]:= InputForm[graph]

Out[2]//InputForm=
Graphics[{{AbsoluteThickness[1], StrokeForm[{GrayLevel[0.], Opacity[1.]}], 
   EdgeForm[None], Line[{{0.19861111111111115, 0.49583333333333335}, {0.540277777777778, 
    0.7430555555555556}}]}, {AbsoluteThickness[1], 
   StrokeForm[{GrayLevel[0.], Opacity[1.]}], EdgeForm[None], 
   Circle[{0.6902777777777779, 0.5597222222222222}, {0.3555555555555555, 
     0.2583333333333335}]}}, ContentSelectable -> True, 
 ImagePadding -> {{0., 0.}, {0., 0.}}, ImageSize -> {480, 360}, 
 PlotRange -> {{0., 1.3333333333333335}, {0., 1.}}, PlotRangePadding -> Automatic]

David,

My gosh! Thank you.

I have this bad habit of “doing” then reading.

Maybe Wolfram should have a button that says “CODE” in the drawing tool for people like me.

Doug