0
$\begingroup$

I want to use Callout to make a label of my joining point, instead of using PlotLabels like this

ListPlot[ {{{2, 0}, {2, 3}}}, Joined -> True, PlotLabels -> Placed["label", Above] ] 

https://i.sstatic.net/mqd5F.jpg

It is working for a point, but I can't make it work for a list of points:

ListPlot[ {{0, 0}, Callout[{1, 1}, "Cool label"], {2, 2}} ] 

Can anyone help?

$\endgroup$
1
  • $\begingroup$ What version are you using? For version 13.0.1, your code ListPlot[ {{0, 0}, Callout[{1, 1}, "Cool label"], {2, 2}}] gives a callout for the 2nd point. $\endgroup$ Commented Jun 22, 2022 at 13:49

1 Answer 1

1
$\begingroup$

One possible implementation could be:

pts = {{0, 0}, {1, 1}, {2, 2}}; lbls = {"one", "cool", "hot"}; ListPlot[Callout[First@#, Last@#] & /@ Transpose[{pts, lbls}], Filling -> Axis] 

enter image description here


EDIT

Or try this variation:

ListPlot[Callout[First@#, Last@#, Above] & /@ Transpose[{pts, lbls}], Filling -> Axis, Epilog -> {Red, Dashed, Line@pts } ] 
$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.