将绘图保存到 tiff,以高分辨率发布(在 R 中) [英] Saving plot to tiff, with high resolution for publication (in R)

查看:59
本文介绍了将绘图保存到 tiff,以高分辨率发布(在 R 中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们要向其发送文章的期刊要求以下内容:

A journal we are sending an article to is asking for the following:

为了确保您的图形的最佳再现质量,我们将欣赏高分辨率文件.所有图形最好采用 TIFF 或 EPS 格式...并且应具有以下分辨率:
图形:800 - 1200 DPI
照片:400 - 800 DPI
颜色(仅 CMYK):300 - 400 DPI(DPI = 每英寸点数)

To ensure the best reproduction quality of your figures we would appreciate high resolution files. All figures should preferably be in TIFF or EPS format... and should have the following resolution:
Graph: 800 - 1200 DPI
Photo: 400 - 800 DPI
Color (only CMYK): 300 - 400 DPI (DPI = dots per inch)

由于我正在发送图表,因此我正在尝试使用 tiff 保存它.

Since I am sending a graph, I am trying to save it using tiff.

这是我使用的代码:

tiff(filename = "c:\\aaa.tiff", 
     res = 800, pointsize = 2)
plot(1:100)
dev.off()    

但遗憾的是,它产生了一个非常笨重"的图像 - 如果我不使用 pointsize = 2,我会收到错误消息:

But sadly, it produces a very "bulky" image - and if I where to not use pointsize = 2, I would get the error message:

plot.new() 错误:图边距太大

Error in plot.new() : figure margins too large

有什么建议吗?

推荐答案

简答:

这是一个庞大的文件,因为分辨率光栅文件 (TIFF) 越高,文件就越大.

It's a bulky file because the higher the resolution raster file (TIFF) then the larger the file.

另一个选项是 EPS,类似于 PDF 或 PS.只需保存其中任何一个.那是一种矢量图像格式,他们说可以接受.它会更紧凑,质量更高(除非您的图形包含大量点或线.)

The other option, EPS, is like PDF or PS. Just save in any of those. That's a vector image format and one they said was acceptable. It will be more compact and of higher quality (unless your figure contains an enormous number of points or lines.)

长答案:

他们要求的一种格式是 TIFF,一种光栅格式.它将信息保存为代表图像中每个像素的值.如果图像是 100 DPI 和 5" 正方形,那么就是 500x500,它可以保存 250000 像素的信息.随着图像的分辨率越来越高,图像尺寸保持不变,那么所需的信息点就会增加.在 200 DPI 下,它是 1000x1000 和1e6 像素的信息.这就解释了为什么您的文件如此庞大.

One format they asked for is TIFF, a raster format. It saves the information as a value representing each pixel in the image. If the image is 100 DPI and 5" square then that's 500x500 and it saves 250000 pixels of information. As the resolution of the image gets higher and the image size stays constant then the points of information needed goes up. At 200 DPI it's 1000x1000 and 1e6 pixels of information. This explains why your file is so bulky.

为了获得 5" 正方形的高质量打印图像,您需要大约 300-400 DPI(每英寸点数).这样您就不会看到构成图像的每个小像素.如果是在较低的分辨率下,图像仍然是 5" x 5",但组成图像的每个单独的方块(像素)都太大了,你可以看到它们.这就是他们要求该分辨率的原因.否则,你的文本和线条图形会显得块状、锯齿状或模糊.这就是为什么您的计算机屏幕上的文本(现在只有 100 DPI 左右)不如打印在一张纸上的质量(通常至少 300 dpi).

In order to have a quality printed image at 5" square you would need about 300-400 DPI (dots per inch). That way you won't see each of those individual little pixels that make up the image. If it's at a lower resolution then the image is still 5" x 5" but each individual square block (pixel) that makes up the image is so large you can see them. That's why they asked for that resolution. Otherwise, text and lines in your graphs would appear blocky, jaggy, or blurry. It's why text on your computer screen (only around 100 DPI these days) isn't nearly as high quality as printed on a piece of paper (usually at least 300 dpi).

他们要求的另一种格式是 EPS.这是封装后记.因为它是一个单页文件,所以 PS 或 postscript 是等效的.而且,PDF 也是类似的.这些都是矢量格式,本质上是相同的矢量格式(它们也可以包含光栅格式图像,但让我们忽略它).

The other format they asked for was EPS. This is encapsulated postscript. Since it's a single page file PS, or postscript, would be equivalent. And, PDF is also similar. These are all vector formats, essentially the same vector format (they can contain raster format images too but let's ignore that).

矢量格式文件保存有关图像绘制方式的信息,但不保存每个像素的信息.如果您将 x 轴 3" 长放置在距离图像底部 0.5" 的位置,则矢量文件知道此描述.图形的每个特征都在文件中进行了描述.因此,对于简单的绘图,在给定的图像质量下,它比任何光栅表示都要紧凑得多.此外,它可以在不损失质量的情况下按比例缩放.您只需要求它以 6" x 6" 而不是 5" x 5" 绘制图像,它还会缩放用于绘制图像组件的每个指令.因此,即使 PDF 或 EPS 文件更紧凑,也能以最高质量打印.

A vector format file saves the information about how the image was drawn but not about each pixel. If you have an x-axis 3" long placed 0.5" from the bottom of the image then the vector file knows this description. Each feature of the graph is described in the file. Because of this, for simple drawings it is vastly more compact than any raster representation at a given image quality. Furthermore, it scales in size without losing quality. You simply ask it to draw the image at 6" x 6" instead of 5" x 5" and it scales each of the instructions for drawing the components of the image up as well. Therefore, even though the PDF or EPS file will be more compact, it will print at the highest quality.

发送 PDF 或 PS 文件,不必担心分辨率.

Send a PDF or PS file and don't worry about the resolution.

这篇关于将绘图保存到 tiff,以高分辨率发布(在 R 中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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