Message Boards Message Boards

Draw a horizontal line with predefined scaled length

Posted 9 years ago

How can a horizontal line be drawn with a predefined length? This code didn't work for length adjustment:

Graphics[Style[Line[{{0, 0}, {100, 0}}], ImageSizeMultipliers -> 0.1]]
POSTED BY: Al Guy
6 Replies
Posted 9 years ago

There should be a command independent on it. There is one for other primitives.

POSTED BY: Al Guy

The actual size depends on the magnification shown at the bottom of the notebook: 100%, etc.

POSTED BY: S M Blinder
Posted 9 years ago

Sorry for persisting. What's the code for a Line with predefined Length to show in notebook?

POSTED BY: Al Guy

Under "Window" pulldown menu select "Show Ruler"

POSTED BY: S M Blinder
Posted 9 years ago

So how to do it without showing up the ruler?

POSTED BY: Al Guy

You can display a 10 cm ruler

Graphics[{Line[{{0, 0}, {10, 0}}], 
  Table[Line[{{x, 0}, {x, -1}}], {x, 0, 10}], 
  Table[Line[{{x, 0}, {x, -.5}}], {x, 0, 10, .1}], Thick, 
  Table[Line[{{x, 0}, {x, -1}}], {x, 0, 10}], 
  Table[Line[{{x, 0}, {x, -.7}}], {x, .5, 9.5}], 
  Table[Text[Style[n, 24], {n, -1.5}], {n, 0, 10}]}]

and then draw any graphic to a relative scale.

Attachments:
POSTED BY: S M Blinder
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