The R Project SVN R

Rev

Rev 61153 | Rev 74265 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61153 Rev 61168
Line 104... Line 104...
104
x <- pmin(3, pmax(-3, stats::rnorm(50)))
104
x <- pmin(3, pmax(-3, stats::rnorm(50)))
105
y <- pmin(3, pmax(-3, stats::rnorm(50)))
105
y <- pmin(3, pmax(-3, stats::rnorm(50)))
106
xhist <- hist(x, breaks = seq(-3,3,0.5), plot = FALSE)
106
xhist <- hist(x, breaks = seq(-3,3,0.5), plot = FALSE)
107
yhist <- hist(y, breaks = seq(-3,3,0.5), plot = FALSE)
107
yhist <- hist(y, breaks = seq(-3,3,0.5), plot = FALSE)
108
top <- max(c(xhist$counts, yhist$counts))
108
top <- max(c(xhist$counts, yhist$counts))
109
xrange <- c(-3,3)
109
xrange <- c(-3, 3)
110
yrange <- c(-3,3)
110
yrange <- c(-3, 3)
111
nf <- layout(matrix(c(2,0,1,3),2,2,byrow = TRUE), c(3,1), c(1,3), TRUE)
111
nf <- layout(matrix(c(2,0,1,3),2,2,byrow = TRUE), c(3,1), c(1,3), TRUE)
112
layout.show(nf)
112
layout.show(nf)
113
 
113
 
114
par(mar = c(3,3,1,1))
114
par(mar = c(3,3,1,1))
115
plot(x, y, xlim = xrange, ylim = yrange, xlab = "", ylab = "")
115
plot(x, y, xlim = xrange, ylim = yrange, xlab = "", ylab = "")
116
par(mar = c(0,3,1,1))
116
par(mar = c(0,3,1,1))
117
barplot(xhist$counts, axes = FALSE, ylim = c(0, top), space = 0)
117
barplot(xhist$counts, axes = FALSE, ylim = c(0, top), space = 0)
118
par(mar = c(3,0,1,1))
118
par(mar = c(3,0,1,1))
119
barplot(yhist$counts, axes = FALSE, xlim = c(0, top), space = 0, horiz = TRUE)
119
barplot(yhist$counts, axes = FALSE, xlim = c(0, top), space = 0, horiz = TRUE)
120
 
120
 
121
par(def.par)#- reset to default
121
par(def.par)  #- reset to default
122
}
122
}
123
\keyword{iplot}
123
\keyword{iplot}
124
\keyword{dplot}
124
\keyword{dplot}
125
\keyword{environment}
125
\keyword{environment}