3
$\begingroup$

I am trying to label the thick black line in the following graph:

enter image description here

Using this source code:

ListLogPlot[{{{0, 0.141026}, {1, 0.141026}, {2, 0.140424}, {3, 0.140424}}, 
Table[{x, 0.1405}, {x, 16, 20}]}, Joined -> {False, True}, PlotStyle -> {{Red, 
PointSize[0.02]}, {Black, Thickness[0.01]}}, PlotRange -> {{0, 25}, {0.12, 0.16}}, Frame -> 
True, FrameLabel -> {"n", "M (GeV)"}, AspectRatio -> 1, ImageSize -> Large, PlotLabels -> 
Placed[{None, "Label"}, Above]]; 

However, the label is appearing quite far above the black line that I want it to label. Is there any way to change the vertical position of the label so that it is right above the black line, or another labeling method that can get around this?

Essentially, the black line is itself a label for the red dots to its left. My intention is to have the line to the right of the data (there will be more in the final version) and a piece of text above it.

$\endgroup$
4
$\begingroup$
pts = {{0, 0.141026}, {1, 0.141026}, {2, 0.140424}, {3, 0.140424}};
ListLogPlot[{
  pts,
  Table[{x, 0.1405}, {x, 5, 9}]
  },
 Joined -> {False, True},
 PlotStyle -> {
   {Red, PointSize[0.02]},
   {Black, Thickness[0.01]}
   },
 PlotRange -> {{0, 25}, {0.12, 0.16}},
 Frame -> True,
 FrameLabel -> {"n", "M (GeV)"},
 AspectRatio -> 1,
 ImageSize -> Large,
 PlotLabels -> {Placed[None, Above], Placed["Label", {7, 0.141}]}
 ]

enter image description here

$\endgroup$

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.