1

I want to annotate a plot where I will be displaying the maximum and minimum values for some plots. When I run the annotate statements individually they print the symbol on the plot correctly. But when I run it in a for loop and generate many plots for many values the symbols are turned into "???".

Please clarify what is the issue.

plot = plot + annotate("text", x = 35, y = 925, label = paste("↑","Max 2009/10",sep=""))

The plot is a part of the function the function loops on its arguments. So the plots getting generated are saved as png in a particular folder. The function and the call are in two different R Scripts

lapply(FUN = get_weather_details,X = list)

Arun Raja
  • 1,554
  • 16
  • 26
  • 1
    Your code works fine both within and outside a for loop when I try it on my system (using the `mtcars` data frame just to have some data to plot). Could you provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so that we can see exactly what data you're plotting and what your loop code looks like? – eipi10 Dec 05 '14 at 06:39
  • Sounds like the character encoding isn't set correctly. – Neal Fultz Dec 05 '14 at 06:40
  • I have added further details to the question. – Arun Raja Dec 05 '14 at 07:08

1 Answers1

-1

When you are running it individually you get the correct symbol, but in loop you get ???. I tried using pch for symbols and I am able to annotate it.

Arun Raja
  • 1,554
  • 16
  • 26