2
$\begingroup$

In a notebook I would like to be able to access and modify the properties of draw tools objects after I've drawn them on a graph by hand.

For example, if make a plot and, with draw tools, make a circle, is it possible now to access the circle Graphics object and its properties with commands in the notebook?

$\endgroup$
2
$\begingroup$

Yes, this is surely possible because the graphics created with the Drawing Tools is just a normal Graphics object. Let me give you an example. I made a new drawing and assigned it to a variable:

Mathematica graphics

Now I can work with img in the same way I would do it with other graphics. For instance you could look at the code you have created:

InputForm[img]
(* Graphics[{Circle[{0.9027777777777779, 0.1972222222222222}, 
   {0.26527777777777783, 0.13611111111111107}], 
  {EdgeForm[{GrayLevel[0.], Opacity[1.], AbsoluteThickness[1]}], 
   FaceForm[Hue[0.5, 1., 1.]], 
   Style[Rectangle[{0.17222222222222228, 0.8083333333333333}, 
     {0.6375000000000002, 0.41388888888888875}], 
    RectangleBoxOptions -> {RoundingRadius -> 0}]}}, 
 ContentSelectable -> True, ImagePadding -> {{0., 0.}, {0., 0.}}, 
 ImageSize -> {480, 360}, PlotRange -> {{0., 1.3333333333333335}, 
  {0., 1.}}, PlotRangePadding -> Automatic] *)

And of course you can manipulate everything for instance by replace parts of the graphics:

img /. Circle[pt_, r_] :> {FaceForm[Red], Disk[pt, r]}

Mathematica graphics

$\endgroup$
  • $\begingroup$ Yes, thank you very much for the quick response. Nice example. It seems rather obvious now. $\endgroup$ – tdgutierrez Mar 19 '14 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.