如何在使用 ggplot2 绘制的点中实现相同的效果?
How to achieve this same effect in the dots being plotted using ggplot2?
我正在使用 R 中的 ggplot2 绘制图表。我使用 Excel 绘制了相同的散点图,我真的很喜欢 Excel 中绘制的点的美感,请参见下图)。
目前我的ggplot2代码如下:
ggplot(mydata2, aes(TotalStay, TotalExpenses)) +
geom_point(shape = 19, position = position_jitter(width = 1, height = .5))
我需要在现有代码中添加什么才能获得与 Excel 中的散点图相同的效果?
使用具有填充和边框颜色的符号并相应地指定两者:
library(ggplot2)
df <- as.data.frame(replicate(2, runif(1e4)))
ggplot(df,aes(V1,V2)) +
geom_jitter(shape=21, width=1, height=.5, fill="#A1C0E5", color="#639DD2") +
theme_minimal()
我正在使用 R 中的 ggplot2 绘制图表。我使用 Excel 绘制了相同的散点图,我真的很喜欢 Excel 中绘制的点的美感,请参见下图)。
目前我的ggplot2代码如下:
ggplot(mydata2, aes(TotalStay, TotalExpenses)) +
geom_point(shape = 19, position = position_jitter(width = 1, height = .5))
我需要在现有代码中添加什么才能获得与 Excel 中的散点图相同的效果?
使用具有填充和边框颜色的符号并相应地指定两者:
library(ggplot2)
df <- as.data.frame(replicate(2, runif(1e4)))
ggplot(df,aes(V1,V2)) +
geom_jitter(shape=21, width=1, height=.5, fill="#A1C0E5", color="#639DD2") +
theme_minimal()