# Trying to get Callout to work with EventSeries and DateListPlot [closed]

I can get ListPlot to work with Callout. Here is toy code:

data = {0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 7, 7, 7};
val1L = ReplacePart[data, 9 -> Callout[0, "First Period End", {10, 1}]]
ListPlot[val1L, Joined -> True]


Producing:

If I create an EventSeries, and then rescale this to have a range of dates, like so:

es = EventSeries[val1L, Automatic]
rescaleTS =
Table[
{DatePlus[
DateObject["January 1, 2020"], {i - 1, "Month"}],
Normal[es][[i]][[2]]},
{i, 1, es["PathLength"]}]


The first part of the output looks like this:

When I plot this with DateListPlot it seems to ignore the Callout wrapper, producing:

For completeness the DateListPlot command is just:

DateListPlot[rescaleES]

• You can use Epilog, e.g., DateListPlot[rescaleTS, Epilog -> {Text["First Period End", {{2020, 9, 1}, 0}, {-1.25, -1.25}]}] – Bob Hanlon Nov 18 at 17:09

You did not form the callout properly. Here is a way that works.

data = {0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 7, 7, 7};
es = EventSeries[data, Automatic];
rescaleTS =
Table[
{DatePlus[
DateObject["January 1, 2020"], {i - 1, "Month"}],
Normal[es][[i]][[2]]},
{i, 1, es["PathLength"]}];
vals = ReplacePart[rescaleTS, 9 -> Callout[rescaleTS[[9]], "First Period End"]];
DateListPlot[vals]


### Update

However, if you were intended to label both period endings, I would recommend:

data = {0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 7, 7, 7};
es = EventSeries[data, Automatic];
rescaleTS =
Table[
{DatePlus[
DateObject["January 1, 2020"], {i - 1, "Month"}],
Normal[es][[i]][[2]]},
{i, 1, es["PathLength"]}];
rescaleTS[[9]] = Callout[rescaleTS[[9]], "1st Period End", After];
rescaleTS[[15]] = Callout[rescaleTS[[15]], "2nd Period End", After];
DateListPlot[rescaleTS]


And, actually, this approach might be better even if you only wanted one callout.