Skip to main content
improved title, explanation/modified tags
Source Link
Syed
  • 59.4k
  • 5
  • 40
  • 95

How to create a line with a label on topcentered above it?

Can anyone help me create a line with a label like thisshown in the picture below? The line is cut indiscontinuous near the middle to accomodate the label. The label is placed on top to avoid the probelemproblem when toothe two points are too close.

enter image description here

This is what I have so far.:

lines[{a1_, a2_}, color_, label_] := Block[{d,l},
d = a2 - a1;
l = Norm[d];
  {Thickness[0.01], color, Line[{a1, a2}]}]

Graphics@lines[{{1, 2}, {3, 5}}, Red]

My plan is to make the line segments about 4/10 of the distance between two points but I'm having problem making that thefrom each end points is on the line through two points instead ofas shown in the outsidefollowing image.

enter image description here

How to create a line with label on top?

Can anyone help me create a line with label like this? The line is cut in the middle. The label is placed on top to avoid the probelem when too points are too close.

enter image description here

This is what I have so far.

lines[{a1_, a2_}, color_, label_] := Block[{d,l},
d = a2 - a1;
l = Norm[d];
  {Thickness[0.01], color, Line[{a1, a2}]}]

Graphics@lines[{{1, 2}, {3, 5}}, Red]

My plan is to make the line segments about 4/10 the distance between two points but I'm having problem making that the end points is on the line through two points instead of the outside.

enter image description here

How to create a line with a label centered above it?

Can anyone help me create a line with a label shown in the picture below? The line is discontinuous near the middle to accomodate the label. The label is placed on top to avoid the problem when the two points are too close.

enter image description here

This is what I have so far:

lines[{a1_, a2_}, color_, label_] := Block[{d,l},
d = a2 - a1;
l = Norm[d];
  {Thickness[0.01], color, Line[{a1, a2}]}]

Graphics@lines[{{1, 2}, {3, 5}}, Red]

My plan is to make the line segments about 4/10 of the distance between two points from each end as shown in the following image.

enter image description here

edited tags
Link
hana
  • 2.6k
  • 6
  • 19
added 279 characters in body
Source Link
hana
  • 2.6k
  • 6
  • 19

Can anyone help me create a line with label like this? The line is cut in the middle. The label is placed on top to avoid the probelem when too points are too close.

enter image description here

This is what I have so far.

lines[{a1_, a2_}, color_, label_] := Block[{d,l},
d = a2 - a1;
l = Norm[d];
  {Thickness[0.01], color, Line[{a1, a2}]}]

Graphics@lines[{{1, 2}, {3, 5}}, Red]

My plan is to make the line segments about 4/10 the distance between two points but I'm having problem making that the end points is on the line through two points instead of the outside.

enter image description here

Can anyone help me create a line with label like this? The line is cut in the middle. The label is placed on top to avoid the probelem when too points are too close.

enter image description here

This is what I have so far.

lines[{a1_, a2_}, color_, label_] := Block[{},
  {Thickness[0.01], color, Line[{a1, a2}]}]

Graphics@lines[{{1, 2}, {3, 5}}, Red]

Can anyone help me create a line with label like this? The line is cut in the middle. The label is placed on top to avoid the probelem when too points are too close.

enter image description here

This is what I have so far.

lines[{a1_, a2_}, color_, label_] := Block[{d,l},
d = a2 - a1;
l = Norm[d];
  {Thickness[0.01], color, Line[{a1, a2}]}]

Graphics@lines[{{1, 2}, {3, 5}}, Red]

My plan is to make the line segments about 4/10 the distance between two points but I'm having problem making that the end points is on the line through two points instead of the outside.

enter image description here

deleted 79 characters in body; edited title
Source Link
hana
  • 2.6k
  • 6
  • 19
Loading
Source Link
hana
  • 2.6k
  • 6
  • 19
Loading