0
我有這個情節,我加載在這裏。我有興趣將遠離零線的異常/遠點(我將選擇多遠)標記出來。在x軸上,我希望只有異常將被寫入x軸。使用ggplot的情節
這是我的代碼:
x_4 <- seq(1000,9999,1)
y1_4 <- comparison4[,1]
y2_4 <- comparison4[,2]
y3_4 <- comparison4[,3]
df <- data.frame(x_4,y4_4,y4_4,y4_4)
require(ggplot2)
ggplot(df, aes(x_4)) +
geom_line(aes(y=y1_4), colour="red") +
geom_line(aes(y=y2_4), colour="green")+
geom_line(aes(y=y3_4), colour="blue") +
scale_x_continuous(breaks=c(1000,2000,3000,4000,5000,6000,7000,8000,9000,9999)) +
geom_point(aes(y=y1_4),shape=8, colour="red",size=0.01)+
geom_point(aes(y=y2_4),shape=6, colour="green",size=0.01)+
geom_point(aes(y=y3_4),shape = 4, colour="blue",size=4)+
xlab("Digit") +
ylab("Frequency") +
ggtitle("Four Digits Benford Distribution")
你的代碼不能運行。 – hrbrmstr
我認爲你需要提供'compare4'? – SN248
也許你應該給你的問題一個更具體的標題。 – maj