4
$\begingroup$

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

enter image description here

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

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

1 Answer 1

11
$\begingroup$

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},
    ScalePadding -> 0.05],
   "   ",
   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},
    ScalePadding -> 0.05]}},
 Background -> LightGray, 
 Dividers -> {{3 -> {Gray, Thick}, 4 -> {White, Thick}}}, 
 Alignment -> {{Left, Center, Right}, Automatic}]

enter image description here

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}
     ]

enter image description here

I like this, but seems someone could simplify it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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