# Displaying NumberLinePlot Vertically?

Is it possible to have NumberLinePlot[] display that axis vertically instead of horizontally?

• Rotate[NumberLinePlot[Prime[Range[10]]], 90 Degree] – Hubble07 Jan 22 '16 at 9:03

I was thinking along the same lines as Hubble07, but I don't care for the way the tick labels get rotated.

Rotate[NumberLinePlot[x^3 < Sin[13 x], x], π/2]

So you can use this,

verticalNumberLinePlot[pred__] := Rotate[
NumberLinePlot[
pred,
Ticks -> {Function[{min, max},
N@Join[{#, Rotate[#, -π/2], {.01, 0}} & /@
FindDivisions[{min, max}, 5],
{#, "", {.005, 0}} & /@ FindDivisions[{min, max}, 25]]]}],
π/2]

It seems to work just as NumberLinePlot, with any option or input specification. I tried on several of the examples on the reference page and none of them broke the functionality.

{verticalNumberLinePlot[x^3 < Sin[13 x], x],
verticalNumberLinePlot[Prime[Range[10]]],
verticalNumberLinePlot[{{Interval[{0, 1}]}, Interval[{0, 2}]}]}

Edit I had originally used AbsoluteOptions to get the tick marks, but I found it to be obscenely slow, doesn't work with all versions of Mathematica, and didn't give the best results. So I switched to using a custom tick function as above. I wish the function could be smaller, but I'm happy with the results.