Format geom_text label doesn't work when using aes_string
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the dot function to format text labels in a plot created with ggplot2 . This works fine when using aes , but doesn't work like expected when using aes_string . Is there a workaround to make it work with aes_string ? require(ggplot2) # Define the format function dot <- function(x, ...) { format(x, ..., big.mark = ".", scientific = FALSE, trim = TRUE) } # Create dummy data df <- data.frame(cbind(levels(iris$Species),c(10000000000,200000,30000))) df$X2 <- as.numeric(as.character(df$X2)) # Works with aes ggplot(iris) + geom_bar(aes