【发布时间】:2023-03-16 14:42:01
【问题描述】:
我是 ggplot2 的新手。我有 2 个不同的数据集,它们的值必须在图表中一起绘制。查看this question 的示例,我尝试使用scale_shape_manual() 和scale_color_manual()。但它不会改变我点的形状和颜色。
我的一小部分代码如下:
qplot(x=TempC7, y=PresshPa7) +
geom_point(aes(x=Temp, y=Pres), data=obsTemp1, na.rm=TRUE) +
scale_shape_manual(values=c(19,19)) +
scale_color_manual(values=c("blue", "red"))
【问题讨论】:
-
您需要在
aes规范中添加颜色和形状。见the documentation。 -
致投反对票的人:请提供一些建设性的反馈以配合您的投票。