You can use paste or paste0 to concatenate strings and then use that as the title:gglist <- lapply(c(4,6,8), function(x){ ggplot(filter(mtcars, cyl == x))+ geom_point(aes(x=vs,y=mpg))+ labs(title = paste("Relationship between vs and mpg when cyl is ", x))})gglist 这篇关于如何在R中动态更改图表标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-02 12:20