The R Project SVN R

Rev

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

Rev 68988 Rev 70685
Line 1... Line 1...
1
% File src/library/graphics/man/plotdefault.Rd
1
% File src/library/graphics/man/plotdefault.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2015 R Core Team
3
% Copyright 1995-2016 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{plot.default}
6
\name{plot.default}
7
\alias{plot.default}
7
\alias{plot.default}
8
\title{The Default Scatterplot Function}
8
\title{The Default Scatterplot Function}
Line 144... Line 144...
144
 
144
 
145
##--- Log-Log Plot  with  custom axes
145
##--- Log-Log Plot  with  custom axes
146
lx <- seq(1, 5, length = 41)
146
lx <- seq(1, 5, length = 41)
147
yl <- expression(e^{-frac(1,2) * {log[10](x)}^2})
147
yl <- expression(e^{-frac(1,2) * {log[10](x)}^2})
148
y <- exp(-.5*lx^2)
148
y <- exp(-.5*lx^2)
149
op <- par(mfrow = c(2,1), mar = par("mar")+c(0,1,0,0))
149
op <- par(mfrow = c(2,1), mar = par("mar")-c(1,0,2,0), mgp = c(2, .7, 0))
150
plot(10^lx, y, log = "xy", type = "l", col = "purple",
150
plot(10^lx, y, log = "xy", type = "l", col = "purple",
151
     main = "Log-Log plot", ylab = yl, xlab = "x")
151
     main = "Log-Log plot", ylab = yl, xlab = "x")
152
plot(10^lx, y, log = "xy", type = "o", pch = ".", col = "forestgreen",
152
plot(10^lx, y, log = "xy", type = "o", pch = ".", col = "forestgreen",
153
     main = "Log-Log plot with custom axes", ylab = yl, xlab = "x",
153
     main = "Log-Log plot with custom axes", ylab = yl, xlab = "x",
154
     axes = FALSE, frame.plot = TRUE)
154
     axes = FALSE, frame.plot = TRUE)
155
my.at <- 10^(1:5)
155
my.at <- 10^(1:5)
156
axis(1, at = my.at, labels = formatC(my.at, format = "fg"))
156
axis(1, at = my.at, labels = formatC(my.at, format = "fg"))
157
at.y <- 10^(-5:-1)
157
e.y <- -5:-1 ; at.y <- 10^e.y
158
axis(2, at = at.y, labels = formatC(at.y, format = "fg"), col.axis = "red")
158
axis(2, at = at.y, col.axis = "red", las = 1,
-
 
159
     labels = as.expression(lapply(e.y, function(E) bquote(10^.(E)))))
159
par(op)
160
par(op)
160
}
161
}
161
\keyword{hplot}
162
\keyword{hplot}