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 want to draw a simple line with some symbols, but so far have had no luck finding an easy way to do it in Mathematica. Does anyone know if Mathematica can easily implement e.g. the example below?


share|improve this question
Try NumberLinePlot in Mathematica 10. – Ernst Stelzer Aug 1 '14 at 13:09
up vote 3 down vote accepted

Just to show some basics using Text, and Line:

text[s_String, s1_String, pos_] := {Text[s, {pos, .04}], Text[s1, {pos, -.04}]}
tick[pos_] := Line[{{pos, .01}, {pos, -.01}}]
Show[Graphics[{Line[{{0, 0}, {1, 0}}]}],
   text["", "0", 0], 
   text["σ2(m1)", "x/2", 1/4], 
   text["", "x/2+1/4", 2/4], 
   text["σ2(m2)", "x/2+1/2", 3/4],
   text["", "1", 1], 
   tick /@ Range[0, 1, 1/4]}]]

Mathematica graphics

share|improve this answer
Thanks, this is great. – Tomaaat Aug 2 '14 at 10:12

Just to give you an idea of what direction to go, try this:

  Graphics[{AbsoluteThickness[2], Line[{{0, 0}, {10, 0}}], 
    Line[{Scaled[{0.25, 0.45}], Scaled[{0.25, 0.55}]}], 
    Line[{Scaled[{0.75, 0.45}], Scaled[{0.75, 0.55}]}]}],
     Style["\!\(\*SubscriptBox[\(\[Sigma]\), \
\(2\)]\)(\!\(\*SubscriptBox[\(m\), \(1\)]\))", 12], 
     Scaled[{0.25, 0.8}]], 
      "\!\(\*SubscriptBox[\(\[Sigma]\), \
\(2\)]\)(\!\(\*SubscriptBox[\(m\), \(2\)]\))", 12], 
     Scaled[{0.75, 0.8}]]}]


which looks like this

enter image description here

Other elements you may draw by analogy. Have fun!

share|improve this answer
This is great. Thanks so much! – Tomaaat Aug 2 '14 at 10:08

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.