2
expr = Uncompress[FromCharacterCode[
    Flatten[ImageData[Import["https://i.stack.imgur.com/Pva9y.png"], "Byte"]]]];
ListLinePlot[expr, PlotRange -> All,ImageSize -> 1000]

enter image description here

As we see, it just 4 Callout labels? But how to show all Callout labels?

yode
  • 26,686
  • 4
  • 62
  • 167

2 Answers2

7
xy = MapIndexed[{#2[[1]], #} &, expr];

data1 = Cases[{p_, Callout[a_, b__]} :> Callout[{p, a}, b]] @ xy;

data2 = xy /. Callout -> (# &);

Show[ListLinePlot[data2], ListPlot[data1], ImageSize -> 800]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896
7

Documentation for Callout says, that "Callouts are pruned to avoid collisions" and advices to use "LabelVisibility" option to control this behaviour:

expr = Uncompress[FromCharacterCode[
Flatten[ImageData[Import["https://i.stack.imgur.com/Pva9y.png"],"Byte"]]]] // 
    ReplaceAll[Callout[args___] :> Callout[args, LabelVisibility -> All]];
ListLinePlot[expr, PlotRange -> All, ImageSize -> 1000]

With LabelVisibility->All

http://reference.wolfram.com/language/ref/LabelVisibility.html

Igor
  • 106
  • 1
  • 3
  • I cannot fully reproduce it in a simple example but I find that often the point that the Callout is attached to needs to be within the PlotRange in order for it to appear even when using LabelVisibility->All. This becomes relevant when combining plots and can be confusing since the points in a ListPlot outside the PlotRange do still get included. Just leaving this comment since it might help someone out who like me is confused why some Callouts still aren't visible. – Kvothe Apr 03 '23 at 15:36