R语言base graphics绘图设置

R语言base graphics绘图系统全局保存了一组参数,控制绘图的区域、颜色、线性、坐标等等

绘图区域(plotting regions)

在这里插入图片描述
inner region = figure region (inner region相对于outer region)
data symbols and lines -> plot region
axes and labels -> figure margins or outer margins

The size and location of the different regions: par()

在这里插入图片描述

Coordinate systems

user coordinates: x,y的坐标轴(axes)的标尺(scales)直观易于理解。
normalized coordinate systems:x和y的范围规范到[0,1], 坐标l是图形位置的相对比例。

Base graphics state

High Level Setting
par() plot() ...
Description
adjJustication of text
annDraw plot labels and titles?
bgBackground color
btyType of box drawn by box()
cex
(cex.axis, cex.lab, cex.main, cex.sub)
Size of text (multiplier)
col
(col.axis, col.lab, c、ol.main, col.sub)
Color of lines and data symbols
familyFont family for text
fgForeground color
font
( font.axis, font.lab, font.main, font.sub)
Font face (bold, italic) for text
labNumber of ticks on axes
lasRotation of text in margins
lend, ljoin, lmitreLine end/join style
ltyLine type (solid, dashed)
lwdLine width
mgpPlacement of axis ticks and tick labels
pchData symbol type
srtRotation of text in plot region
tckLength of axis ticks (relative to plot size)
tclLength of axis ticks (relative to text size)
xaxpNumber of ticks on x-axis
xaxsCalculation of scale range on x-axis
xaxtX-axis style (standard, none)
xpdClipping region
yaxpNumber of ticks on y-axis
yaxsCalculation of scale range on y-axis
yaxtY-axis style (standard, none)
Low Level Setting
par()
Description
figLocation of figure region (normalized)
finSize of figure region (inches)
lheightLine spacing (multiplier)
maiSize of figure margins (inches)
marSize of figure margins (lines of text)
mexLine spacing in margins
mfcolNumber of figures on a page
mfgWhich figure is used next
mfrowNumber of figures on a page
newHas a new plot been started?
omaSize of outer margins (lines of text)
omdLocation of inner region (normalized)
omiSize of outer margins
pinSize of plot region (inches)
pltLocation of plot region (normalized)
psSize of text (points)
ptyAspect ratio of plot region
usrRange of scales on axes
xlogLogarithmic scale on x-axis?
ylogLogarithmic scale on y-axis?

Read-only setting

Setting
par("xxx")
Description Section
cinSize of a character (inches)
craSize of a character (\pixels")
cxySize of a character (user coordinates)
dinSize of graphics device (inches)
pageWill the next plot start a new page?

绘图控制项分类

设置项设置变量
颜色
color
col, fg, bg. (fill pattern: density, angle)
线
line
lty, lwd
ljoin, lend, lmitre
文本
text
size: ps, cex
font: font, family
justification: adj(坐标点相对于text区域的位置)
rotation: srt
axes and title: ann
multi-line: lheigh
数据展现
data symbol
pch (point character), cex, ps, type
坐标轴
axes
ticks marks: lab, xaxp, yaxp
position: mgp
length: tck, tck
axes style: xaxs, yaxs
axes type: xaxt, yaxt (s/n)
transformation: xlog, ylog
axes border: bty (box type)
limits: xlim, ylim
绘图区
plot region
outer region: oma
figure region: fig(l, r, b, t), fin(w, h)
figure margin:mar(b, l, t, r), mai (inches), mex (multifier)
plot region: plt(l,r, b, t) - ratio. pin(w, h) in inches.
occupy type: pty (m|s)
在这里插入图片描述
裁剪
clipping
xpd; clip()
新起绘图区
new plot
new, devAskNewPage()提示是否新起一页
一页多图
multiple plots
mfrow/mfcol
function: layout(), split.screen(), screen(), erase.screen(), close.screen()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值