grid(graphics)
grid()所属R语言包:graphics
Add Grid to a Plot
电网图
译者:生物统计家园网 机器人LoveR
描述----------Description----------
grid adds an nx by ny rectangular grid to an existing plot.
gridnx ny矩形网格,以现有的图添加。
用法----------Usage----------
grid(nx = NULL, ny = nx, col = "lightgray", lty = "dotted",
lwd = par("lwd"), equilogs = TRUE)
参数----------Arguments----------
参数:nx,ny
number of cells of the grid in x and y direction. When NULL, as per default, the grid aligns with the tick marks on the corresponding default axis (i.e., tickmarks as computed by axTicks). When NA, no grid lines are drawn in the corresponding direction.
在X和Y方向的网格单元的数量。当NULL,为默认的网格对齐相应的默认轴(即计算axTickstickmarks)的刻度。当NA,没有网格线绘制在相应的方向。
参数:col
character or (integer) numeric; color of the grid lines.
字符或(整数)数值;网格线的颜色。
参数:lty
character or (integer) numeric; line type of the grid lines.
字符或(整数)数值;线网格线类型。
参数:lwd
non-negative numeric giving line width of the grid lines.
网格线非负数值的线宽。
参数:equilogs
logical, only used when log coordinates and alignment with the axis tick marks are active. Setting equilogs = FALSE in that case gives non equidistant tick aligned grid lines.
逻辑,仅用于日志坐标轴刻度对齐时活跃。设置equilogs = FALSE在这种情况下,给出了非等距刻度对齐网格线。
注意----------Note----------
If more fine tuning is required, use abline(h = ., v = .) directly.
如果需要更多的微调,abline(h = ., v = .)直接使用。
参考文献----------References----------
参见----------See Also----------
plot, abline, lines, points.
plot,abline,lines,points。
举例----------Examples----------
plot(1:3)
grid(NA, 5, lwd = 2) # grid only in y-direction[电网只在y方向]
## maybe change the desired number of tick marks: par(lab=c(mx,my,7))[#也许改变所需数量的刻度杆(实验室= C(MX,我7))]
op <- par(mfcol = 1:2)
with(iris,
{
plot(Sepal.Length, Sepal.Width, col = as.integer(Species),
xlim = c(4, 8), ylim = c(2, 4.5), panel.first = grid(),
main = "with(iris, plot(...., panel.first = grid(), ..) )")
plot(Sepal.Length, Sepal.Width, col = as.integer(Species),
panel.first = grid(3, lty=1,lwd=2),
main = "... panel.first = grid(3, lty=1,lwd=2), ..")
}
)
par(op)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|