如何在R图中指定点的线宽?

时间:2021-11-08 01:37:01

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.

基本R图函数通常使用参数lwd来指定线条粗细。这些是相对线宽,不同的帮助文件表明这是一个倍增因素。因此线宽lwd = 1给出的线宽为1 * defaultwidth。

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?

我在哪里指定线的默认宽度,或者如何确定一条线,例如特别是0.75pt,如Excel等其他软件中设置的那样?

1 个解决方案

#1


7  

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:

默认线宽取决于用于绘图的设备。为了阅读这些信息,您应该了解英寸,点和像素的一般解释。一般规则是:

  • a point is 1/72 of an inch
  • 一点是1/72英寸

  • a pixel is standard 1/96 of an inch, or 0.75 points.
  • 像素是标准的1/96英寸,或0.75点。

This can depend however on the settings of your device:

但这取决于您设备的设置:

  • the pdf() and postscript() devices:
    • standard a point is seen as 1/72 inch
    • 标准一点被视为1/72英寸

    • lwd = 1 refers to a linewidth of 1/96 inch or 0.75 points.
    • lwd = 1指的是1/96英寸或0.75点的线宽。

  • pdf()和postscript()设备:标准点为1/72英寸lwd = 1表示线宽为1/96英寸或0.75点。

  • the png(), jpeg(), tiff() and bmp() devices:
    • standard a point is seen as 1/72 inch
    • 标准一点被视为1/72英寸

    • this can be chanced by setting the argument res which defines the ppi (points per inch).
    • 这可以通过设置定义ppi的参数res(每英寸点数)来实现。

    • lwd = 1 is 1/96 of an inch but takes the settings of res into account. So if res = 96, lwd = 1 is a thickness of 1pt, but your point is interpreted smaller than a regular point.
    • lwd = 1是1/96英寸,但考虑了res的设置。因此,如果res = 96,则lwd = 1的厚度为1pt,但您的点被解释为小于常规点。

  • png(),jpeg(),tiff()和bmp()设备:标准一个点被视为1/72英寸,这可以通过设置定义ppi的参数res(每英寸点数)来实现。 lwd = 1是1/96英寸,但考虑了res的设置。因此,如果res = 96,则lwd = 1的厚度为1pt,但您的点被解释为小于常规点。

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, a lwd = 1 with a setting of res = 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).

另外请记住,对于位图设备,较高的res设置会使您的数字在屏幕上爆炸。所以在前面的例子中,设置为res = 96的lwd = 1给出了一条厚度为1pt的线,但是在同一屏幕上显示这将使线宽从1像素增加到1.33像素。如果将两个数字缩放为完全相同的大小,它们看起来相同(显然除了分辨率)。

See also:

How do I specify axis thickness in a plot? (in R)

如何在图中指定轴厚度? (在R中)

Increasing the thickness of box lines in an R boxplot?

增加R箱图中箱线的厚度?

https://graphicdesign.stackexchange.com/questions/199/point-vs-pixel-what-is-the-difference

#1


7  

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:

默认线宽取决于用于绘图的设备。为了阅读这些信息,您应该了解英寸,点和像素的一般解释。一般规则是:

  • a point is 1/72 of an inch
  • 一点是1/72英寸

  • a pixel is standard 1/96 of an inch, or 0.75 points.
  • 像素是标准的1/96英寸,或0.75点。

This can depend however on the settings of your device:

但这取决于您设备的设置:

  • the pdf() and postscript() devices:
    • standard a point is seen as 1/72 inch
    • 标准一点被视为1/72英寸

    • lwd = 1 refers to a linewidth of 1/96 inch or 0.75 points.
    • lwd = 1指的是1/96英寸或0.75点的线宽。

  • pdf()和postscript()设备:标准点为1/72英寸lwd = 1表示线宽为1/96英寸或0.75点。

  • the png(), jpeg(), tiff() and bmp() devices:
    • standard a point is seen as 1/72 inch
    • 标准一点被视为1/72英寸

    • this can be chanced by setting the argument res which defines the ppi (points per inch).
    • 这可以通过设置定义ppi的参数res(每英寸点数)来实现。

    • lwd = 1 is 1/96 of an inch but takes the settings of res into account. So if res = 96, lwd = 1 is a thickness of 1pt, but your point is interpreted smaller than a regular point.
    • lwd = 1是1/96英寸,但考虑了res的设置。因此,如果res = 96,则lwd = 1的厚度为1pt,但您的点被解释为小于常规点。

  • png(),jpeg(),tiff()和bmp()设备:标准一个点被视为1/72英寸,这可以通过设置定义ppi的参数res(每英寸点数)来实现。 lwd = 1是1/96英寸,但考虑了res的设置。因此,如果res = 96,则lwd = 1的厚度为1pt,但您的点被解释为小于常规点。

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, a lwd = 1 with a setting of res = 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).

另外请记住,对于位图设备,较高的res设置会使您的数字在屏幕上爆炸。所以在前面的例子中,设置为res = 96的lwd = 1给出了一条厚度为1pt的线,但是在同一屏幕上显示这将使线宽从1像素增加到1.33像素。如果将两个数字缩放为完全相同的大小,它们看起来相同(显然除了分辨率)。

See also:

How do I specify axis thickness in a plot? (in R)

如何在图中指定轴厚度? (在R中)

Increasing the thickness of box lines in an R boxplot?

增加R箱图中箱线的厚度?

https://graphicdesign.stackexchange.com/questions/199/point-vs-pixel-what-is-the-difference