I want to plot a time series with ggplot(), time line created with strptime().
So far ok: I am getting German abbreviations for the months on the time axis, my locale is set to Sys.setlocale("LC_TIME"="de_DE.UTF-8"). When I do months() with my data, they show up in German, too.
Weird: When I set my locale to Sys.setlocale("LC_TIME"="en_GB.UTF-8"), months() will give me English months BUT ggplot() will continue to have GERMAN abbreviations for months on the time-axis.
I've tried some other categories of Sys.setlocale() but to no avail.
Where does ggplot() take the information about which language to choose?
I realize how late I am with this response, but I got the same problem and stumbled on your thread while looking for solution.
For me
Sys.setenv(LANGUAGE="en")
Sys.setlocale("LC_TIME", "English")
solved it.
The easiest way to make it work is:
Sys.setlocale("LC_ALL", "en_US.UTF-8")
After that all ggplots have a proper date labels.
If you need to change only the time format this should suffice:
Sys.setlocale("LC_TIME", "en_US.UTF-8")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With