Hi all,I'm working on a chloropleth and trying to change the default legend. As it stands, the legend outputs value in scientific notation. Instead of having (2e+03,4e+04] I would prefer to have "2k to 4k". My code is below.#ggplot code
m2$exp <- cut(as.numeric(m2[,13]), breaks = c(seq(0, 14000, by = 2000)))cbbPalette <- brewer.pal(6, "Greens")map = ggplot(m2, aes(long, lat, group = group)) +geom_polygon(aes(fill = exp), colour = I("black"), size = 0.2) +scale_fill_manual(values=cbbPalette, name = "Expenditure/EGM") +ylab("Latitude") +xlab("Longitude") +theme(panel.background = element_blank())#breaks=c("(2k to 4k"),("4k to 6k"), ("6k to 8k"),("8kto 10K"),("10k to 12k"), ("12k to 14k"))
mapThe 'breaks' line I commented out used to be after the "exp" in aes(fill=exp) so it was aes(fill=exp, breaks=c("(2k to 4k"),("4k to 6k"), ("6k to 8k"),("8kto 10K"),("10k to 12k"), ("12k to 14k"))) but unfortunately this didn't do the trick. I've also put a picture of the work in progress below to help.
Thanks very much for any advice.cheers,Kyle
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2