更改颜色 r 中的 ggally ggparcoord 图
changing a color s a ggally ggparcoord plot in r
ggparcoord(data = df, columns = 1:4, mapping=aes(color=as.factor(Species)))+
scale_color_discrete("Species",labels=levels(df$Species))
如何将此绘图的标准颜色更改为 stesoa=black、versicolor=green 和 virginica=mageanta?
您可以使用 scale_color_manual()
设置自定义颜色:
ggparcoord(df,
columns = 1:4,
mapping = aes(color = as.factor(Species))) +
scale_color_manual("Species",
values = c("black", "green", "magenta"),
labels = levels(df$Species))
ggparcoord(data = df, columns = 1:4, mapping=aes(color=as.factor(Species)))+
scale_color_discrete("Species",labels=levels(df$Species))
如何将此绘图的标准颜色更改为 stesoa=black、versicolor=green 和 virginica=mageanta?
您可以使用 scale_color_manual()
设置自定义颜色:
ggparcoord(df,
columns = 1:4,
mapping = aes(color = as.factor(Species))) +
scale_color_manual("Species",
values = c("black", "green", "magenta"),
labels = levels(df$Species))