The R Project SVN R

Rev

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

Rev 61153 Rev 61156
Line 130... Line 130...
130
## Show the different plot types
130
## Show the different plot types
131
x <- 0:12
131
x <- 0:12
132
y <- sin(pi/5 * x)
132
y <- sin(pi/5 * x)
133
op <- par(mfrow = c(3,3), mar = .1+ c(2,2,3,1))
133
op <- par(mfrow = c(3,3), mar = .1+ c(2,2,3,1))
134
for (tp in c("p","l","b",  "c","o","h",  "s","S","n")) {
134
for (tp in c("p","l","b",  "c","o","h",  "s","S","n")) {
135
   plot(y ~ x, type = tp,
-
 
136
        main = paste("plot(*, type = \"",tp,"\")", sep = ""))
135
   plot(y ~ x, type = tp, main = paste0("plot(*, type = \"", tp, "\")"))
137
   if(tp == "S") {
136
   if(tp == "S") {
138
      lines(x,y, type = "s", col = "red", lty = 2)
137
      lines(x,y, type = "s", col = "red", lty = 2)
139
      mtext("lines(*, type = \"s\", ...)", col = "red", cex = .8)
138
      mtext("lines(*, type = \"s\", ...)", col = "red", cex = 0.8)
140
   }
139
   }
141
}
140
}
142
par(op)
141
par(op)
143
 
142
 
144
##--- Log-Log Plot  with  custom axes
143
##--- Log-Log Plot  with  custom axes