[英]Scatter plot in R
我不確定每列3帶有顏色的xy圖是否是可視化此圖的最佳方法。 如果residues2
為常數,則為prob。 最好將其全部忽略,並將其他值相互繪制。
也許您可以根據需要調整以下內容:
df1 <- data.frame(r1=seq(4), r2=rep(1,4),
c1=c(0.99613318, 0.98771518, 0.98681384, 0.99225447) )
### give order (for plotting)
df1 <- within(df1, c2 <- rank(c1))
### create blank plot
with(df1, plot(r1,r2, xlab="residues_1", ylab="residues_2", cex.lab=1.5))
### strongest red to largest color
with(df1, points(r1, r2, cex=15, pch=19, col = rev(heat.colors(4))[c2] ))
### make legend
l1 <- as.matrix(df1[ ,"c1"])
graphics::legend("topright", legend=l1, lty=1, title="covariance", lwd=3,
col = rev(heat.colors(4))[df1$c2], cex=2)
給予:
(我將圖像元素的尺寸過大,並在保存為.png
之前手動調整了尺寸,以便在此處更好地顯示)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.