Message Boards Message Boards


How insert drawing pad into cell of GraphicsRow?

Posted 9 years ago
0 Replies
0 Total Likes

Given a graphics row something like this:

g1 = Graphics[{White, Disk[]}, PlotRange -> {{-1, 1}, {-1, 1}}];
g2 =
    Rectangle[{-Sqrt[2]/2, -Sqrt[2/2]}]
GraphicsRow[{g1, g2}, Background -> Black]

I would like to be able to make a simple mouse-driven line drawing in one cell, say the right side. This cell will have other graphics predrawn within it. The following snippet written by Vitaliy Kaurov is about what I'm looking for in terms of functionality.

 pts = If[Last[pts] == p, pts, pts~Join~{p}];
 ListLinePlot[pts, PlotRange -> {{-10, 10}, {-10, 10}}, PlotLabel -> Framed@Length[pts]],
 {{p, {0, 0}}, Locator},
 {{pts, {{0, 0}}}, ControlType -> None}]

See How to create a drawing pad in Mathematica?

I haven't had much luck putting these things together. Perhaps someone can steer me in the right direction. Eventually I want to embed this within a more complicated manipulate, but I'm trying to begin with the basics.

POSTED BY: Gary Palmer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract