2017-10-20 61 views
1

您能否告诉我,有没有其他方法可以以比这更好的方式绘制重复数据?这个图中的重复不清楚。绘制带重复点的数据

enter image description here

library(ggplot2) 
p <- ggplot(output, aes(output$Longitudes, output$Latitudes)) 
p + geom_text(aes(x = jitter(output$Longitudes), y = 
jitter(output$Latitudes)),check_overlap = FALSE, size =5) 
p + geom_point(position = "jitter") 

表示上的特定点的复制的目的是要表明的发生。

回答

1

形象化重复的点,你可以:(例如,alpha = 0.1

  • 添加抖动(例如,使用geom_jitter
  • alpha
  • 点的减少大小(例如,size = 1)的点
  • 变化的形状(例如,shape = 21

编号:

# Generate data 
df <- reshape2::melt(data.frame(A = rep(0, 1e3), B = rep(1, 1e3))) 
# Plot data 
library(ggplot2) 
ggplot(df, aes(variable, value)) + 
    geom_jitter(alpha = 0.5, size = 2, shape = 21) + 
    theme_classic() 

简介:

enter image description here

+1

谢谢:)它的伟大! – Saara

+0

@Saara乐意帮忙:-) – PoGibas

+0

:)祝您有美好的一天! – Saara