找回密码
 注册
查看: 2565|回复: 0

R语言:dev2bitmap()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:08:14 | 显示全部楼层 |阅读模式
dev2bitmap(grDevices)
dev2bitmap()所属R语言包:grDevices

                                        Graphics Device for Bitmap Files via Ghostscript
                                         图形设备通过Ghostscript的位图文件

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

bitmap generates a graphics file. dev2bitmap copies the current graphics device to a file in a graphics format.
bitmap生成的图形文件。 dev2bitmap当前图形设备复制图形格式的文件。


用法----------Usage----------


bitmap(file, type = "png16m", height = 7, width = 7, res = 72,
       units = "in", pointsize, taa = NA, gaa = NA, ...)

dev2bitmap(file, type = "png16m", height = 7, width = 7, res = 72,
           units = "in", pointsize, ...,
           method = c("postscript", "pdf"), taa = NA, gaa = NA)



参数----------Arguments----------

参数:file
The output file name, with an appropriate extension.
输出文件的名称,适当延长。


参数:type
The type of bitmap. the default is "png256".
位图的类型。默认"png256"。


参数:width, height
Dimensions of the display region.
显示区域的尺寸。


参数:res
Resolution, in dots per inch.
分辨率,每英寸的点数。


参数:units
The units in which height and width are given.  Can be in (inches), px (pixels), cm or mm.
所在单位height和width给出。可以in(英寸),px(像素),cm或mm。


参数:pointsize
The pointsize to be used for text: defaults to something reasonable given the width and height
用于文本来合理的pointsize:默认的宽度和高度


参数:...
Other parameters passed to postscript or pdf.
其他参数传递postscript或pdf。


参数:method
Should the plot be done by postscript or pdf?
图应该做postscript或pdf?


参数:taa, gaa
Number of bits of antialiasing for text and for graphics respectively.  Usually 4 (for best effect) or 2.  Not supported on all types.
数位抗锯齿的文字和图形分别。通常是4(最佳效果)或2。不支持的所有类型。


Details

详情----------Details----------

dev2bitmap works by copying the current device to a postscript or pdf device, and post-processing the output file using ghostscript. bitmap works in the same way using a postscript device and post-processing the output as "printing".
dev2bitmap工程通过复制当前设备postscript或pdf设备,后处理的输出文件使用ghostscript。 bitmap工作在相同的使用postscript设备和后处理输出作为“印刷”的方式。

You will need ghostscript: the full path to the executable can be set by the environment variable R_GSCMD. (If this is unset the setting of GSC is used, otherwise command "gswin32c.exe", which will work if it is in your PATH.)
您将需要ghostscript:可执行文件的完整路径,可以设置环境变量R_GSCMD。 (如果这是unsetGSC使用,否则命令"gswin32c.exe",将工作的设置,如果它是在你的PATH。)

The types available will depend on the version of ghostscript, but are likely to include "pcxmono", "pcxgray", "pcx16", "pcx256", "pcx24b", "pcxcmyk", "pbm", "pbmraw", "pgm", "pgmraw", "pgnm", "pgnmraw", "pnm", "pnmraw", "ppm", "ppmraw", "pkm", "pkmraw", "tiffcrle", "tiffg3", "tiffg32d", "tiffg4", "tifflzw", "tiffpack", "tiff12nc", "tiff24nc", "tiff32nc" "psmono", "psgray", "psrgb", "bit", "bitrgb", "bitcmyk", "pngmono", "pnggray", "pngalpha", "png16", "png256", "png16m", "png48", "jpeg", "jpeggray", "pdfwrite".
可用的类型将取决于版本ghostscript,但可能包括"pcxmono","pcxgray","pcx16","pcx256","pcx24b" "pcxcmyk","pbm","pbmraw","pgm","pgmraw","pgnm","pgnmraw","pnm","pnmraw","ppm","ppmraw","pkm","pkmraw","tiffcrle","tiffg3","tiffg32d","tiffg4" ,"tifflzw","tiffpack","tiff12nc","tiff24nc","tiff32nc""psmono","psgray","psrgb", "bit","bitrgb","bitcmyk","pngmono","pnggray","pngalpha","png16","png256",<X >,"png16m","png48","jpeg","jpeggray"。

The default type, "png16m", supports 24-bit colour and anti-aliasing.  Versions of R prior to 2.7.0 defaulted to "png256", which uses a palette of 256 colours and could be a more compact representation.  Monochrome graphs can use "pngmono", or "pnggray" if anti-aliasing is desired. Plots with a transparent background and varying degrees of transparency should use "pngalpha".
默认的类型,"png16m",支持24位颜色和抗锯齿。 R版本到2.7.0之前拖欠"png256",它采用了256色的调色板,可能是一个更紧凑的表示。单色图形可以使用"pngmono"或"pnggray"如果反走样所需。一个透明的背景和不同程度的透明度图,应使用"pngalpha"。

Note that for a colour TIFF image you probably want "tiff24nc", which is 8-bit per channel RGB (the most common TIFF format).  None of the listed TIFF types support transparency.  "tiff32nc" uses 8-bit per channel CMYK, which printers might require.
请注意,你可能想"tiff24nc",这是8位每通道RGB(最常见的TIFF格式)彩色TIFF图像。没有上市的TIFF类型支持透明度。 "tiff32nc"每通道的CMYK,它的打印机可能需要使用8位。

For formats which contain a single image, a file specification like Rplots%03d.png can be used: this is interpreted by Ghostscript.
这对于一个单一的形象,像Rplots%03d.png可以用文件规范的格式,其中包含由Ghostscript的解释。

For dev2bitmap if just one of width and height is specified, the other is chosen to preserve aspect ratio of the device being copied.  The main reason to prefer method = "pdf" over the default would be to allow semi-transparent colours to be used.
dev2bitmap如果只是一个width和height指定的,其他则选择保存方面的设备,被复制的比率。喜欢method = "pdf"超过预设的主要理由是让要使用半透明的颜色。

For graphics parameters such as "cra" that need to work in pixels, the default resolution of 72dpi is always used.
对于图形参数,如"cra",需要在像素,72DPI的默认分辨率始终使用。

Paths for file and R_GSCMD which contain spaces are mapped to short names via shortPathName.
file和R_GSCMD其中的路径包含空格,通过shortPathName短名称映射到。


值----------Value----------

None.
没有。


公约----------Conventions----------

This section describes the implementation of the conventions for graphics devices set out in the &ldquo;R Internals Manual&rdquo;.  These devices follow the underlying device, so when viewed at the stated res:
本节介绍的“R内部手册”所载的图形设备的公约的执引号况。这些设备遵循的基本设备,所以当在规定的res看:

The default device size is 7 inches square.
默认设备大小为7英寸见方。

Font sizes are in big points.
字体大小大点。

The default font family is (for the standard Ghostscript setup) URW Nimbus Sans.
默认字体家族(标准Ghostscript的设置)URW雨云SANS。

Line widths are as a multiple of 1/96 inch, with no minimum.
线宽为1/96英寸的多,没有最低。

Circle of any radius are allowed.
允许任何半径的圆。

Colours are interpreted by the viewing/printing application.
颜色被解释查看/打印应用程序。


注意----------Note----------

Use of bitmap will leave a temporary file (with file name starting Rbit).
使用bitmap会留下一个临时文件(文件名,开始Rbit)。

Although using type = "pdfwrite" will work for simple plots, it is not recommended.  Either use pdf to produce PDF directly, or call ps2pdf -dAutoRotatePages=/None on the output of postscript: that command is optimized to do the conversion to PDF in ways that these functions are not.
虽然使用type = "pdfwrite"工作简单的图,这是不推荐使用。或者使用pdf直接生成PDF,或致电ps2pdf -dAutoRotatePages=/None输出postscript“:该命令进行了优化,这样做的方式,这些功能都没有转换为PDF。


参见----------See Also----------

savePlot, which for windows and X11(type = "cairo") provides a simple way to record a PNG record of the current plot.
savePlot,windows和X11(type = "cairo")提供了一个简单的方法来记录当前的图PNG纪录。

postscript, pdf, png, jpeg, tiff and  bmp.
postscript,pdf,png,jpeg,tiff和bmp。

To display an array of data, see image.
要显示的数据数组,看到image。

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 08:47 , Processed in 0.034055 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表