我是社区的新手,我在搜索在线提到的解决方案时多次尝试后发布了这个.但是,我无法解决它.
以下代码
dat<-read.csv("Harvard tutorial/Rgraphics/dataSets/EconomistData.csv")
g <- ggplot(dat, aes(dat$CPI, dat$HDI))
g1 <- g + theme_bw() + geom_smooth(method = "lm", formula = y ~log(x), se = FALSE, color = "Red", linetype = 1, weight = 3) +
geom_point(aes(color = Region), size = 4, fill = 4, alpha = 1/2, shape = 1) +
scale_x_continuous(name = "Corruption Perception Index", breaks = NULL) +
scale_y_continuous(name = "Human Development Index") +
scale_color_manual(name = "Region of the world", values = c("#24576D", "#099DD7", "#28AADC", "#248E84", "#F2583F", "#96503F")) …Run Code Online (Sandbox Code Playgroud)