Message Boards Message Boards

0
|
3278 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Code from drawings

Posted 10 years ago

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.

Attachments:
POSTED BY: Douglas Youvan
2 Replies

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

POSTED BY: Douglas Youvan

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:

enter image description here

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]
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract