- 图例设置(如何将图例放在图外)
- legend(x, y = NULL, legend, fill = NULL,col =, bty = "o",xjust = 0, yjust = 1, x.intersp = 1, y.intersp =1, adj = c(0, 0.5), text.width = NULL,xpd=TRUE)
- 散点图矩阵
- library(car)scatterplotMatrix(~ mpg + disp + drat + wt, data=mtcars, spread=FALSE, smoother.args=list(lty=2), main="Scatter Plot Matrix via car Package
- 相关图
(1)corrgram()函数格式:
- corrgram(x, order=, panel=, text.panel=, diag.panel=)
其中,x是一行一个观测的数据框。当order = TRUE时,相关矩阵将使用主成分分析法对变 量重新排序,这使得二元变量的关系模式更为 明显。选项panel 设定非对角线面板使用的元素类型。可通过选项lower.panel和upper.panel 来分别设置主对角线下方和上方的元素类型。 text.panel和diag.panel选项控制着主对角线元素类型。
(2)相关图例子:
- library(corrgram)corrgram(mtcars, order=TRUE, lower.panel=panel.shade, upper.panel=panel.pie, text.panel=panel.txt, main="Corrgram of mtcars intercorrelations")
- ggplot绘制画中画的方法(细节放大)


雷达卡



京公网安备 11010802022788号







