I am currently trying to generate an automated script to create a labeled line graph. This line graphs will have 1 or more maxima that if they are above a certain threshold must be labeled. Currently I can label the maxima just fine.
For that I am using textxy() in the calibrate package
However when multiple peaks occur things get more complicated:
It quickly becomes difficult to see where the label is assigned to. So what I would like is a line from the label to the top (or just below) of the peak.
I've looked around all day today with no luck. I tried everything in Intelligent point label placement in R
wordcloud, but that unfortunately doesn't allow you to offset the labels, and fails if you have only one label.
identify, is much too slow. I need to be able to automate this to do thousands of images a day.
pointLabel, thigmophobe.labels both didn't work as they don't draw a line, and I am not dealing with lots of labels anyway.
I also tried manually drawing an arrow between the label and the point, but that got very time consuming.
Does anyone know of any package or easy way to do this? Is this not possible to automate?
Thanks! Cameron