如何在R图中以点为单位指定线粗度? [英] How to specify line thickness in points in an R plot?
问题描述
R底图函数通常使用参数 lwd
指定线宽.但是,这些是相对的线宽,不同的帮助文件表明这是一个乘数.因此,线宽 lwd = 1
给出的线宽为 1 * defaultwidth
.
The base R plot functions commonly use the argument lwd
for specifying the line thickness. These are relative line widths though, and different help files indicate that this is a multiplying factor. So a linewidth lwd = 1
gives a line width of 1 * defaultwidth
.
我在哪里指定该行的默认宽度,或者如何确保该行是例如在其他软件(如Excel)中设置的0.75pt?
Where do I specify the default width for the line, or how can I make sure a line is eg specifically 0.75pt, as set in other software like Excel?
推荐答案
默认线宽取决于绘图所用的设备.为了阅读此信息,您应该了解英寸,点和像素的一般解释.一般规则是:
The default line width is dependent on the device used for the plotting. In order to read this information, you should be aware of the general interpretation of inches, points and pixels. The general rules are:
- 点是1/72英寸 像素是标准的1/96英寸或0.75点.
- a point is 1/72 of an inch
- a pixel is standard 1/96 of an inch, or 0.75 points.
但这可能取决于您设备的设置:
This can depend however on the settings of your device:
-
pdf()
和postscript()
设备:- 标准点被视为1/72英寸
-
lwd = 1
表示线宽为1/96英寸或0.75点.
- the
pdf()
andpostscript()
devices:- standard a point is seen as 1/72 inch
lwd = 1
refers to a linewidth of 1/96 inch or 0.75 points.
- 标准点被视为1/72英寸
- 这可以通过设置参数
res
来定义ppi(每英寸的点数)来实现. -
lwd = 1
是1/96英寸,但考虑了res
的设置.因此,如果res = 96
,则lwd = 1
的厚度为1pt,但是您的点被解释为小于常规点.
- standard a point is seen as 1/72 inch
- this can be chanced by setting the argument
res
which defines the ppi (points per inch). lwd = 1
is 1/96 of an inch but takes the settings ofres
into account. So ifres = 96
,lwd = 1
is a thickness of 1pt, but your point is interpreted smaller than a regular point.
还请记住,使用位图设备时,更高的
res
设置会炸毁屏幕上的图形.因此,在前面的示例中,设置为res = 96
的lwd = 1
给出了一条线,粗细为1pt,但是在同一屏幕上显示,这会增加线宽从1像素到1.33像素.如果将两个数字缩放为完全相同的大小,则它们看起来是相同的(显然与分辨率不同).Also keep in mind that with the bitmap devices, a higher setting of
res
will blow up your figure on screen. So in the previous example, alwd = 1
with a setting ofres = 96
gives a line with a thickness of 1pt, but shown on the same screen this will increase the line thickness from 1 pixel to 1.33 pixels. If you scale both figures to be exactly the same size, they look the same (apart from the resolution obviously).另请参阅:
https://graphicdesign.stackexchange.com/questions/199/point-vs-pixel-什么是差异
这篇关于如何在R图中以点为单位指定线粗度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!