如何在R图中以点为单位指定线粗度? [英] How to specify line thickness in points in an R plot?

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

问题描述

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() 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英寸
      • 这可以通过设置参数 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 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 = 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, 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-什么是差异

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

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