# How can I draw a ruler?

I would like to draw a ruler in the vertical position.

Ideally, the numbers are horizontal and I can choose begin, end and steps (eg from 1000 to 1200 with steps of 10).

• What would you measure with such a ruler? Commented May 3, 2021 at 12:28
• @Luigi: maybe you can expand on this: community.wolfram.com/groups/-/m/t/428047
– Moo
Commented May 3, 2021 at 12:36
• @bill s: it is an indicator that varies over a linear scale and whose range can change sligthly Commented May 3, 2021 at 13:28
• as in Graphics@GeometricTransformation[{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}]}, RotationTransform[Pi/2]] Commented May 3, 2021 at 16:31
• I would use VerticalGauge for purpose of displaying different values. It is highly customizable. Commented May 3, 2021 at 16:37

Something to point you in a possible direction...

Updated a second time with some modifications from the original. (I clearly have too much time on my hands today and I fully recognize the silliness of the changes ;-)

 Grid[{{
VerticalGauge[0, {0, 2},
Background -> LightGray,
GaugeMarkers -> None,
ScaleDivisions -> {2, 4},
TicksStyle -> {{Black, FontSize -> 14}, Gray},
"   ",
Column[{Rotate["Ruler ", 270 Degree],
Rotate["Ruler +", 90 Degree]}],
"  ",
VerticalGauge[0, {0, 7},
Background -> LightGray,
GaugeMarkers -> None,
ScaleDivisions -> {5, 2},
ScaleOrigin -> {0, {1, 0}},
TicksStyle -> {{Black, FontSize -> 14}, Gray},
Background -> LightGray,
Dividers -> {{3 -> {Gray, Thick}, 4 -> {White, Thick}}},
Alignment -> {{Left, Center, Right}, Automatic}]


And...building on @chris's comment:

   Manipulate[
Grid[
{
{
Graphics[
GeometricTransformation[{
Line[{{0, 0}, {l, 0}}],
Table[Line[{{x, 0}, {x, -1}}], {x, 0, l}],
Table[Line[{{x, 0}, {x, -.5}}], {x, 0, l, .1}],
Thick,
Table[Line[{{x, 0}, {x, -1}}], {x, 0, l}],
Table[Line[{{x, 0}, {x, -.7}}], {x, .5, l - 0.5}],
Table[Text[Style[n, 24], {n, -1.5}], {n, 0, l}]},
RotationTransform[90 Degree]],
ImageSize -> 75
],
" ",
Column[{Rotate["Ruler ", 270 Degree],
Rotate["Ruler +", 90 Degree]}],
"",
Graphics[
GeometricTransformation[{
Line[{{0, 0}, {l, 0}}],
Table[Line[{{x, 0}, {x, -1}}], {x, 0, l}],
Table[Line[{{x, 0}, {x, -.5}}], {x, 0, l, .1}],
Thick,
Table[Line[{{x, 0}, {x, -1}}], {x, 0, l}],
Table[Line[{{x, 0}, {x, -.7}}], {x, .5, l - 0.5}],
Table[Text[Style[n, 24], {n, -1.5}], {n, 0, l}]},
RotationTransform[270 Degree]],
ImageSize -> 75
]
}
},
Background -> LightGray,
Dividers -> {{3 -> {Gray, Thick}, 4 -> {White, Thick}}},
Alignment -> {{Left, Center, Right}, Automatic}
],
{{l, 10}, 1, 10, 1}
]


I like this, but seems someone could simplify it.