[R] Saved EPS/PDF graphics not same as JPG/BMP graphics

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Jun 22 13:59:38 CEST 2011



On 22.06.2011 13:50, John Kruschke wrote:
> The error happens when using the savePlot() command, like this:
> savePlot( file="TestSavePlot.eps" , type="eps" )
> savePlot( file="TestSavePlot.jpg" , type="jpg" )

Well, plot directly into a device, for postscript:

postscript("estSavePlot.eps", additionalArguments .....)
plot(1:10)
dev.off()

Uwe Ligges


> The images in the two saved files are not the same, with the JPG being
> correct but the EPS being wrong.
>
> When you suggest "starting separate devices explicitly", what do you mean?
> (I've skimmed through the results of ??device, but can't make sense of it.)
> Thank you!
>
> John K. Kruschke, Professor
>
>
> 2011/6/22 Uwe Ligges<ligges at statistik.tu-dortmund.de>
>
>> I guess you use the menu to save the plots from your Windows device into
>> files rather than starting separate devices explicitly?
>> If so, please use explicit calls to the devices and everything happens as
>> you define it.
>>
>> Uwe Ligges
>>
>>
>>
>>
>> On 22.06.2011 04:31, John Kruschke wrote:
>>
>>> When I save a particular plot as JPG or BMP, the saved image is an
>>> accurate
>>> copy of that plot.
>>> But when I save the same plot as EPS or PDF, some text elements are
>>> incorrectly altered.
>>> An example is attached. Notice in the top middle and top right panels, the
>>> x-axis labels have correct subscript 1 in the JPG, but incorrect subscript
>>> 2
>>> in the EPS.
>>>
>>> I'm using R 2.13.0 on Windows 7.
>>>
>>> Any clues regarding the source of this error and its solution would be
>>> appreciated. For example, are there EPS/PDF device drivers that need to be
>>> separately updated?
>>>
>>> Many thanks.
>>>
>>> John K. Kruschke, Professor
>>> <http://www.indiana.edu/%**7Ekruschke/**DoingBayesianDataAnalysis/<http://www.indiana.edu/%7Ekruschke/DoingBayesianDataAnalysis/>
>>>>
>>>
>>>
>>>
>>> ______________________________**________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>>> PLEASE do read the posting guide http://www.R-project.org/**
>>> posting-guide.html<http://www.R-project.org/posting-guide.html>
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>



More information about the R-help mailing list