Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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

share|improve this answer
    
Yes, thank you very much for the quick response. Nice example. It seems rather obvious now. –  tdgutierrez Mar 19 at 22:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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