且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何以点为单位指定线宽?

更新时间:2023-02-02 10:30:11

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

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 点.

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

This can depend however on the settings of your device:

  • pdf()postscript() 设备:
    • 标准点被视为 1/72 英寸
    • lwd = 1 指的是 1/96 英寸或 0.75 磅的线宽.
    • the pdf() and postscript() 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 英寸
      • 这可以通过设置定义 ppi(每英寸点数)的参数 res 来实现.
      • lwd = 1 是 1/96 英寸,但考虑了 res 的设置.因此,如果 res = 96lwd = 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 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.

      还要记住,对于位图设备,较高的 res 设置会在屏幕上炸毁您的图形.所以在前面的例子中,设置为 res = 96lwd = 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, 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).

      另见:

      如何在剧情?(在 R 中)

      增加 R 中方框线的粗细箱线图?

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