CSV vs ps
我想知道OP是否直接对cex
感兴趣.从?par
:
cex一个数字值,给出绘图文本和符号相对于默认值应放大的量.当设备打开时,它从1开始,当布局更改(例如通过设置mfrow)时,它被重置.
听起来他们想以点为单位设置字体大小,听起来更像是ps
.从?par
:
ps integer;文本(但不包括符号)的点大小.
当然,当需要重置情节标题或任何其他情节元素的放大倍率时,OP确实会对cex
感兴趣.在我的机器上,cex为1似乎是12分,因此,cex = 1.5将是18分.
字体系列
OP还希望将字体系列设置为SAL,根据操作系统和设置的不同,语法可能不同.
在Windows上,可以使用windowsFonts()
判断默认字体映射:
Windows
windowsFonts()
#> $serif
#> [1] "TT Times New Roman"
#>
#> $sans
#> [1] "TT Arial"
#>
#> $mono
#> [1] "TT Courier New"
创建于2024年5月06日,共有reprex v2.1.0个
这在我的Windows机器上表明SAL已经映射到sans.
Macintosh / Linux
在Macintosh / Linux上,您可能会使用X11Fonts()
来实现此目的:
X11Fonts()
#> $serif
#> [1] "-*-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $sans
#> [1] "-*-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $mono
#> [1] "-*-courier-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $Times
#> [1] "-adobe-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $Helvetica
#> [1] "-adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $CyrTimes
#> [1] "-cronyx-times-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $CyrHelvetica
#> [1] "-cronyx-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $Arial
#> [1] "-monotype-arial-%s-%s-*-*-%d-*-*-*-*-*-*-*"
#>
#> $Mincho
#> [1] "-*-mincho-%s-%s-*-*-%d-*-*-*-*-*-*-*"
创建于2024年5月06日,共有reprex v2.1.0个
这表明亚马尔映射到亚马尔.
当然,如果尚未映射所需的字体,字体映射可能会变得更加复杂.幸运的是,SAL似乎是一种相当标准的字体.
例如
我想OP可能对看到这样的东西更感兴趣.
请注意,鉴于所有文本似乎大小相同,cex.axis和cex.lab的默认值似乎已经设置为1.我还将其渲染到word文档中以判断字体大小,至少当输出到word时,绘图字体为12磅.
par(ps = 12)
plot(
pressure,
main = "pressure by temperature",
family = "sans", # as per my window machine font mappings
cex.main = 1, # re-set title magnification from 1.5? default
font.main = 1 # re-set title format to plain from bold default
)
创建于2024年5月06日,共有reprex v2.1.0个