Menu

[r1]: / trunk / R / generic.scatter.plot.R  Maximize  Restore  History

Download this file

20 lines (19 with data), 553 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
generic.scatter.plot <- function(x,y,ann=NULL,pch=1,
fit.line=F,axis.round=2,...) {
par(mfrow=c(1,1))
plot(x,y,type='n',bty='n',xaxt='n',yaxt='n',...)
axis(1,round(quantile(x),axis.round),lty=0,las=3)
axis(2,round(quantile(y),axis.round),lty=0,las=1)
axis(1,x,rep("+",length(x)),lty=0,line=-1)
axis(2,y,rep("+",length(y)),lty=0,line=-1)
if(fit.line) {
fit <- lm(y ~ x)
abline(fit)
}
if(!is.null(ann)) {
text(x,y,ann)
} else {
points(x,y,pch=pch)
}
mtext(paste('n =',length(x)))
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.