plot(data$x, data$y) 1. 2. 3. 4. 5. 6. 7. 8. 9. 利用plot函数绘制出所需的图形,这里以绘制散点图为例。 ### 设置cex大小 ```markdown ```R # 设置点的大小为1.5倍(可以根据需求调整) par(cex = 1.5) 1. 2. 3. 4. 5. 6. 7. 8. 9. 通过par函数设置cex参数,可以调整绘制出的...
## [1] plot.acf* plot.data.frame* plot.decomposed.ts* ## [4] plot.default plot.dendrogram* plot.density* ## [7] plot.ecdf plot.factor* plot.formula* ## [10] plot.function plot.hclust* plot.histogram* ## [13] plot.HoltWinters* plot.isoreg* plot.lm* ## [16] plot.medpolish*...
ylab = '') text(x = 2,y = 2, labels = 'I am text !', cex = 2, col = 'purple', srt = 45) # 建空画板 plot(1:3,1:3,type = 'n',axes = T,frame.plot = T,xlab = '',ylab = '') # 对齐 text(x = 2,y = 2, labels = 'I am text !', cex = 2, col = '...
mRocFuction=function(td=null,pt = null,of=null){ #td要使用的数据名,pt要看的时间段 rbCol=rainbow(6) par(mar= c(5,5,1,1),cex.lab=1.2,cex.axis= 1.2) sROC=survivalROC(Stime=td$surtime, status=td$surstat, marker = td$gene87, predict.time =pt, #时间改为pt,方便改要看的时间段 ...
plot(roc1, max.auc.polygon=FALSE, # 填充整个图像 smooth=F, # 绘制不平滑曲线 main="Comparison of ROC curves", # 添加标题 col="red", # 曲线颜色为红色 legacy.axes=TRUE) # 使横轴从0到1,表示为1-特异度 并逐步添加其他条曲线 plot.roc(roc2, ...
基础函数paris()函数用于创建散点图矩阵,panel.cor()函数是自定义的面板函数(panel function),用于在矩阵的上三角显示相关度;下三角使用系统预定义的平滑函数,用于在矩阵的下三角显示散点图和平滑曲线。 panel.cor <- function(x, y, digits =2, prefix ="", cex.cor, ...) ...
main=par("cex.main"), legend.plot=length(levels(groups)) > 1, legend.pos=NULL, row1attop=TRUE, ...) ## 参数注释: diagonal # 对角线面板显示的内容, adjust # 用于密度估计的相对带宽(relative bandwidth),传递给density()函数nclass # 直方图的封箱的数量,传递给hist()函数plot.points # 是否在...
plot_confusion_matrix <- function(cm, classes, normalize=FALSE, title='Confusion matrix', cmap=heat.colors(10)) { if (normalize) { cm <- cm / rowSums(cm) } op <- par(mar = c(6,6,3,1)) image(1:nrow(cm), 1:ncol(cm), t(cm[nrow(cm):1,]), col = cmap, xaxt = 'n'...
plot(<vecter_horizontal>, <vector_vertical>, pch=as.integer(<factors>),col,xlab,ylab)——用factors区分图像点的类型pch(圆的,三角,叉),col是颜色类别,xlab或者ylab对应横纵轴标题 legend(<location="topright">,legend=<vector_labelname>,pch=1:3,cex=1,col)——图例,<location>是位置(比如右上),...
text(0.5, 0.5, txt, cex = cex.cor * r) } # 2. 自定义函数pannel.hist:展示各个变量的直方图 panel.hist <- function(x, ...) { usr <- par("usr"); on.exit(par(usr)) par(usr = c(usr[1:2], 0, 1.5) ) h <- hist(x, plot ...