Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using "Drawing Tools" to decorate an imported image (a TIFF file). I need to create a set of regularly spaced parallel lines, and my solution for doing this is to create a pair of parallel lines (we have an LHS line and an RHS line), copy this pair, superimpose the copied LHS line on the previous RHS line, and then delete the previous RHS line. Doing this repeatedly gives me an array of parallel lines, which are all a fixed distance apart.

My question is: while selecting multiple graphics primitives (lines here) how do I snap one primitive to a previously placed primitive decorating the image similar to how one can do this in Adobe Illustrator?

Also, is there an easier way for me to automatically generate a set of parallel lines which can be translated / stretched apart using my mouse?

share|improve this question
up vote 3 down vote accepted

For the second part of your question, you can simply generate them in a cell:

Graphics[Line[Table[{{x, -10}, {x , 10}} , {x, 1, 10} ]]]

enter image description here

then copy and paste them into a graphic, where they're a group that can be moved, stretched, etc.

lena in jail

share|improve this answer
Thanks that's very helpful! But I can't seem to paste into the graphic? It seems to just copy over the image? Using "Show[...]" also doesn't seem to work. – Bob Mar 24 '13 at 14:06
It's all to do with what you've got selected, and choosing the right menu option. Some experimentation is probably the best way - it's harder to write about than to do. – cormullion Mar 24 '13 at 14:16
I'm sure I'll get it eventually. Thanks! – Bob Mar 24 '13 at 14:20
I'm used to using Illustrator, so it's hard to switch into the Mathematica way of interactive drawing. But at least you can automate some of the graphics generation...:) – cormullion Mar 24 '13 at 14:27

Your Answer


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.