将PDF导入Inkscape时出现颜色渐变问题

时间:2017-09-05 19:09:28

标签: r pdf graphics vector-graphics inkscape

我正在制作一个带有R中颜色条的图形,我将其导入到InkScape中进行注释等。我的工作流程是在R中创建图形,将其另存为PDF,然后将该PDF导入InkScape。但是,当我将PDF导入InkScape时,图形的颜色条会从垂直渐变变为垂直+水平渐变。

为了说明,这是原始PDF文件中的颜色条:

enter image description here

以下是将其导入InkScape时的样子:

enter image description here

中心轴看起来正确,但横向渐变不正确。

如果我将图像从R导出为PNG文件,然后使用相同的步骤将其导入InkScape,则颜色栏会正确导入。因此,似乎该问题与矢量化图形有关。但是,我更希望将图像保持为矢量化格式,以保持不同分辨率的质量。

绘图的其余部分(包括使用颜色渐变的栅格)在导入时看起来很正常;唯一的问题是彩条。

在将PDF导入InkScape时,有没有人知道如何保留颜色渐变?

供参考,以下是我用来在R中创建PDF的代码:

pdf(paste0(path.fig, "Figure_HeatMaps_NoText.pdf"), width=(190/25.4), height=(190/25.4), useDingbats=F)
grid.arrange(
  grid.arrange(p.dd.years + theme(text=element_blank(), plot.margin=unit(c(0.5,8,4,0.5), "mm")), 
               p.dd.diff + theme(text=element_blank(), plot.margin=unit(c(0.5,8,4,0.5), "mm")), 
               ncol=2, widths=c(0.8, 1), newpage=F),
  grid.arrange(p.MaxTSA.years + theme(text=element_blank(), plot.margin=unit(c(4,8,0.5,0.5), "mm")), 
               p.MaxTSA.diff + theme(text=element_blank(), plot.margin=unit(c(4,8,0.5,0.5), "mm")), 
               ncol=2, widths=c(0.8, 1), newpage=F),
  ncol=1, newpage=F)
dev.off()

This question似乎与外围有关;但是,在我的PDF导出中设置useDingbats=F并不能解决问题。

0 个答案:

没有答案
相关问题