You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.
palette()
[1] "black""red""green3""blue""cyan""magenta""yellow""gray"
palette(c("red","blue","green","orange"))
palette()
[1] "red""blue""green""orange"# To revert back to the default palette type:
palette("default")
设置字体
字体一般通过 par() 来设置,例如:
par(family="serif",font=2)
A font is specified in two parts: a font family (such as Helvetica or Arial) and a font face within that family (such as bold or italic).
The available font families vary by operating system and graphics devices. So R provides some proxy values which are mapped on to the relevant available fonts irrespective of the system. Standard values for family are "serif", "sans", and "mono".
The font argument takes numerical values: 1 corresponds to plain text (the default), 2 to bold face, 3 to italic, and 4 to bold italic.
The fonts for axis annotations, labels, and plot main title can be set separately using the font.axis, font.lab, and font.main arguments respectively.
设置各种元素的颜色
Setting colors for text elements: axis annotations, labels, plot titles, and legends
得到下图:
R 内置的默认颜色组:
设置字体
字体一般通过
par()
来设置,例如:A font is specified in two parts: a font
family
(such as Helvetica or Arial) and a fontface
within that family (such as bold or italic).The available font families vary by operating system and graphics devices. So R provides some proxy values which are mapped on to the relevant available fonts irrespective of the system. Standard values for family are "serif", "sans", and "mono".
The font argument takes numerical values: 1 corresponds to plain text (the default), 2 to bold face, 3 to italic, and 4 to bold italic.
The fonts for axis annotations, labels, and plot main title can be set separately using the
font.axis
,font.lab
, andfont.main
arguments respectively.点和线的种类和样式
点的种类通过
pch
参数设置,共25种:线的样式和粗细分别通过
lty
和lwd
来设置:得到下图:
Line type number values correspond to types of lines:
We can also use the character strings instead of numbers, for example,
lty="dashed"
instead oflty=2
.设置坐标轴标签和刻度
可以分别通过
xaxp
和yaxp
设置坐标轴的范围和间距,格式为c(min,max,n)
。得到:
las
参数可以设置坐标轴刻度标识与轴的方向关系:0: always parallel to the axis (default)
1: always horizontal
2: always perpendicular to the axis
3: always vertical
The text was updated successfully, but these errors were encountered: