2
$\begingroup$

How to type each label in the upper right position? For example adding {0.25,0.25} to each point.

 primeirocolor = RGBColor[0.368417, 0.506779, 0.709798];
 lista = Table[{RandomInteger[{1, 5}], RandomInteger[{1, 8}]}, {i, 1, 8}]

 nomes = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight"}

 ListPlot[ MapThread[Labeled, {lista, nomes}]]

 lp = Labeled[  ListPlot[   MapThread[Labeled, {lista, nomes}], PlotStyle -> {Red, PointSize -> .016},    PlotTheme -> "Detailed", LabelStyle -> {20, Bold},    ImageSize -> Full]  , {Rotate["Oposición", Pi/2], "Baremo"}, {Left, Bottom},   LabelStyle -> {32, Bold}]
$\endgroup$
3
$\begingroup$

It may be easier to use the offset argument ofText. In the following I try to illustrate this. I have not dealt with the duplicate issue (i.e. the same integer pair being generated). Using the variables in OP:

nomes = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", 
  "Eight"}
off[x_, y_] := 
 Graphics[{Red, PointSize[0.02], Point@lista, Blue, 
   MapThread[Text[#1, #2, {x, y}] &, {nomes, lista}]}, 
  PlotRange -> {{0, 9}, {0, 9}}, AspectRatio -> Automatic]
Manipulate[
 off[offset[[1]], offset[[2]]], {{a, 0}, -1, 1, 
  Appearance -> "Labeled"},
 {{offset, {0, 0}}, {-5, -5}, {5, 5}, Appearance -> "Labeled"}]

enter image description here

$\endgroup$
1
$\begingroup$

The third argument of Labeled is the control of positions, as in format {object_pos, label_pos}. label_pos will be {0, 0} because you want the left-bottom corner of the label to be placed at the right-top corner, that is {1, 1} for the object_pos.

ListPlot[{Labeled[{1, 1}, "test", {{1, 1}, {0, 0}}]}] 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.