如何以点为单位指定线宽? [英] How to specify line thickness in points a plot?

查看:80
本文介绍了如何以点为单位指定线宽?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本 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.

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

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

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

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

      这篇关于如何以点为单位指定线宽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆