3
$\begingroup$

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?

example

$\endgroup$
1
3
$\begingroup$

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}}]}],
 Graphics[{
   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

$\endgroup$
0
0
$\begingroup$

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

 Show[{
  Graphics[{AbsoluteThickness[2], Line[{{0, 0}, {10, 0}}], 
    AbsoluteThickness[1], 
    Line[{Scaled[{0.25, 0.45}], Scaled[{0.25, 0.55}]}], 
    Line[{Scaled[{0.75, 0.45}], Scaled[{0.75, 0.55}]}]}],
  Graphics[{Text[
     Style["\!\(\*SubscriptBox[\(\[Sigma]\), \
\(2\)]\)(\!\(\*SubscriptBox[\(m\), \(1\)]\))", 12], 
     Scaled[{0.25, 0.8}]], 
    Text[Style[
      "\!\(\*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!

$\endgroup$
1
  • $\begingroup$ This is great. Thanks so much! $\endgroup$
    – Tomaaat
    Aug 2 '14 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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