R 为什么ggplot给我一张空白图表?
我想了解为什么我不能用我的代码生成图形。我有R 为什么ggplot给我一张空白图表?,r,ggplot2,R,Ggplot2,我想了解为什么我不能用我的代码生成图形。我有 > dput(CWEEM_df) structure(list(scale = c(2L, 3L, 4L, 5L, 6L, 7L, 2L, 3L, 4L, 5L, 6L, 7L), CWEEM = c(0.322195198733443, 0.495806796612831, 0.833288896397849, 0.795473436370842, 0.819476963392047, 0.90126867844622, 0.34221
> dput(CWEEM_df)
structure(list(scale = c(2L, 3L, 4L, 5L, 6L, 7L, 2L, 3L, 4L,
5L, 6L, 7L), CWEEM = c(0.322195198733443, 0.495806796612831,
0.833288896397849, 0.795473436370842, 0.819476963392047, 0.90126867844622,
0.342214826198644, 0.464825881280908, 0.725655531611074, 0.720349006361943,
0.536530647330033, 0.8585486983613), legends = c("kilianindex->MSCI",
"kilianindex->MSCI", "kilianindex->MSCI", "kilianindex->MSCI",
"kilianindex->MSCI", "kilianindex->MSCI", "MSCI->kilianindex",
"MSCI->kilianindex", "MSCI->kilianindex", "MSCI->kilianindex",
"MSCI->kilianindex", "MSCI->kilianindex")), class = "data.frame", row.names = c(NA,
-12L))
与
我得到一个空的图:
为什么?您需要添加一个
geom…
库(ggplot2)
ggplot(数据=CWEEM_df,aes(x=比例,y=CWEEM,颜色=图例))+
几何点()
由(v2.0.0)于2021-05-03创建。您需要添加一个
geom…
库(ggplot2)
ggplot(数据=CWEEM_df,aes(x=比例,y=CWEEM,颜色=图例))+
几何点()
由(v2.0.0)于2021年5月3日创建
library(ggplot2)
p=ggplot(data = CWEEM_df, aes(x = scale, y = CWEEM, colour=legends))
plot(p)