An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110816/7f55f67a/attachment.pl>
postscript( does not save the plot
10 messages · Sarah Goslee, Marc Schwartz, Alaios +2 more
Hi,
On Tue, Aug 16, 2011 at 1:32 PM, Alaios <alaios at yahoo.com> wrote:
Dear all,
I am using the following code to write the plot to an eps format
postscript(file="test.eps",horizontal=FALSE)
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars =list(whisklwd=0,staplelwd=0))
dev.off()
A reproducible example would be a lot more help.
This creates a 6kb eps file, that can not be opened by any program. I tired with photoshop gimp, acrobat reader. This is the normal process I follow to save my plots.
And on what OS, version of R, etc? This could be a system problem, so we need to know what that system is. sessionInfo() would be helpful.
dev.off always returns 1. and the boxplot function succesfullu does the plot in the screen. What might be the problem? I would like to thank you in advance for your help B.R Alex
Sarah
Sarah Goslee http://www.functionaldiversity.org
On Aug 16, 2011, at 12:32 PM, Alaios wrote:
Dear all,
I am using the following code to write the plot to an eps format
postscript(file="test.eps",horizontal=FALSE)
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars =list(whisklwd=0,staplelwd=0))
dev.off()
This creates a 6kb eps file, that can not be opened by any program. I tired with photoshop gimp, acrobat reader. This is the normal process I follow to save my plots.
dev.off always returns 1.
and the boxplot function succesfullu does the plot in the screen.
What might be the problem?
I would like to thank you in advance for your help
B.R
Alex
You did not create an EPS file. See ?postscript and pay attention to the fourth paragraph under Details:
The postscript produced for a single R plot is EPS (Encapsulated PostScript) compatible, and can be included into other documents, e.g., into LaTeX, using \includegraphics{<filename>}. For use in this way you will probably want to use setEPS() to set the defaults as horizontal = FALSE, onefile = FALSE, paper = "special". Note that the bounding box is for the device region: if you find the white space around the plot region excessive, reduce the margins of the figure region viapar(mar=).
HTH,
Marc Schwartz
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110817/27bdcdd7/attachment.pl>
Not sure what output you get in the first case. You don't need:
ps.options=setEPS()
just:
setEPS()
Using:
set.seed(1)
test <- matrix(runif(500*500), 500)
setEPS()
postscript(file = "exponcoverapprox.eps")
boxplot(test[30, 1:500], test[90, 1:500], test[150, 1:500], test[210, 1:500],
test[270, 1:500], test[330, 1:500], test[390, 1:500],
names = c("1", "3", "5", "8", "10", "13", "1"), outline = FALSE,
ylim=c(0.01, 50), log = "y", xlab = "xvalue", ylab = "yvalue",
boxwex=0.5, pars = list(whisklwd = 0, staplelwd = 0))
dev.off()
I get the attached output which seems to be OK.
Marc
-------------- next part --------------
On Aug 17, 2011, at 10:02 AM, Alaios wrote:
The problem is a bit weird.
This does not work:
ps.options=setEPS()
postscript(file="exponcoverapprox.eps")
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars
=list(whisklwd=0,staplelwd=0))
dev.off()
This works
postscript(file="exponcoverapprox.eps")
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5)
dev.off()
To not bother you with the details, the only difference is the pars
=list(whisklwd=0,staplelwd=0) at the end of the boxplot , which I use to remove the whiskers fromt he blot.
B.R
________________________________
From: Marc Schwartz <marc_schwartz at me.com>
Cc: "R-help at r-project.org" <R-help at r-project.org>
Sent: Tuesday, August 16, 2011 7:38 PM
Subject: Re: [R] postscript( does not save the plot
On Aug 16, 2011, at 12:32 PM, Alaios wrote:
Dear all,
I am using the following code to write the plot to an eps format
postscript(file="test.eps",horizontal=FALSE)
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars =list(whisklwd=0,staplelwd=0))
dev.off()
This creates a 6kb eps file, that can not be opened by any program. I tired with photoshop gimp, acrobat reader. This is the normal process I follow to save my plots.
dev.off always returns 1.
and the boxplot function succesfullu does the plot in the screen.
What might be the problem?
I would like to thank you in advance for your help
B.R
Alex
You did not create an EPS file. See ?postscript and pay attention to the fourth paragraph under Details:
The postscript produced for a single R plot is EPS (Encapsulated PostScript) compatible, and can be included into other documents, e.g., into LaTeX, using \includegraphics{<filename>}. For use in this way you will probably want to use setEPS() to set the defaults as horizontal = FALSE, onefile = FALSE, paper = "special". Note that the bounding box is for the device region: if you find the white space around the plot region excessive, reduce the margins of the figure region viapar(mar=).
HTH,
Marc Schwartz
1 day later
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110819/a5dd35ac/attachment.pl>
On Aug 19, 2011, at 8:06 AM, Alaios wrote:
Dear Marc,
I would like to thank you for your answer.
Unfortunately still
setEPS()
postscript(file="exponcoverapprox.eps")
boxplot
(test
[30,1
:
500
],exponper
[90,1
:
500
],test
[150,1
:
500
],test
[210,1
:
500
],test
[270,1
:
500
],test
[330,1
:
500
],test
[390,1
:
500
],names
=
c
("1
","3","5","8","10","13","15"),outline=FALSE,ylim=c(0.01,50),log="y",
xlab =
"Xlabel",ylab="Ylabel,boxwex=0.5,pars=list(whisklwd=0,staplelwd=0) )
dev.off()
still does not work, though the
The code you posted does not parse. There is a lissing closing quote in the ylab argument.
David.
>
>
>
> setEPS()
> postscript(file="exponcoverapprox.eps")
> boxplot
> (test
> [30,1
> :
> 500
> ],exponper
> [90,1
> :
> 500
> ],test
> [150,1
> :
> 500
> ],test
> [210,1
> :
> 500
> ],test
> [270,1
> :
> 500
> ],test
> [330,1
> :
> 500
> ],test
> [390,1
> :
> 500
> ],names
> =
> c
> ("1
> ","3","5","8","10","13","15"),outline=FALSE,ylim=c(0.01,50),log="y",
> xlab =
> "Xlabel",ylab="Ylabel,boxwex=0.5)
> dev.off()
>
> works fine! It seems that the problem is with the pars=list(.
>
> Just to make it more clear. The dev.off() returns 1 and the file is
> created. The problem is that this file can not be open with any
> program, while all the other .eps files I have and were created by
> R, with the above methodology work really nice.
>
> B.R
> Alex
>
>
>
> ________________________________
> From: Marc Schwartz <marc_schwartz at me.com>
>
> Cc: "R-help at r-project.org" <R-help at r-project.org>
> Sent: Wednesday, August 17, 2011 5:48 PM
> Subject: Re: [R] postscript( does not save the plot
>
> Not sure what output you get in the first case. You don't need:
>
> ps.options=setEPS()
>
> just:
>
> setEPS()
>
>
> Using:
>
> set.seed(1)
> test <- matrix(runif(500*500), 500)
>
> setEPS()
>
> postscript(file = "exponcoverapprox.eps")
>
> boxplot(test[30, 1:500], test[90, 1:500], test[150, 1:500],
> test[210, 1:500],
> test[270, 1:500], test[330, 1:500], test[390, 1:500],
> names = c("1", "3", "5", "8", "10", "13", "1"), outline =
> FALSE,
> ylim=c(0.01, 50), log = "y", xlab = "xvalue", ylab = "yvalue",
> boxwex=0.5, pars = list(whisklwd = 0, staplelwd = 0))
>
> dev.off()
>
>
> I get the attached output which seems to be OK.
>
> Marc
>
>
>
> On Aug 17, 2011, at 10:02 AM, Alaios wrote:
>
>> The problem is a bit weird.
>>
>> This does not work:
>>
>> ps.options=setEPS()
>> postscript(file="exponcoverapprox.eps")
>> boxplot
>> (test
>> [30,1
>> :
>> 500
>> ],test
>> [90,1
>> :
>> 500
>> ],test
>> [150,1
>> :
>> 500
>> ],test
>> [210,1
>> :
>> 500
>> ],test
>> [270,1
>> :
>> 500
>> ],test
>> [330,1
>> :
>> 500
>> ],test
>> [390,1
>> :
>> 500
>> ],names
>> =
>> c
>> ("1
>> ","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y",
>> xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars
>> =list(whisklwd=0,staplelwd=0))
>> dev.off()
>>
>>
>>
>>
>> This works
>> postscript(file="exponcoverapprox.eps")
>> boxplot
>> (test
>> [30,1
>> :
>> 500
>> ],test
>> [90,1
>> :
>> 500
>> ],test
>> [150,1
>> :
>> 500
>> ],test
>> [210,1
>> :
>> 500
>> ],test
>> [270,1
>> :
>> 500
>> ],test
>> [330,1
>> :
>> 500
>> ],test
>> [390,1
>> :
>> 500
>> ],names
>> =
>> c
>> ("1
>> ","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y",
>> xlab = "xvalue",ylab="yvalue",boxwex=0.5)
>> dev.off()
>>
>>
>>
>> To not bother you with the details, the only difference is the pars
>> =list(whisklwd=0,staplelwd=0) at the end of the boxplot , which I
>> use to remove the whiskers fromt he blot.
>>
>> B.R
>>
>>
>>
>> ________________________________
>> From: Marc Schwartz <marc_schwartz at me.com>
>>
>> Cc: "R-help at r-project.org" <R-help at r-project.org>
>> Sent: Tuesday, August 16, 2011 7:38 PM
>> Subject: Re: [R] postscript( does not save the plot
>>
>> On Aug 16, 2011, at 12:32 PM, Alaios wrote:
>>
>>> Dear all,
>>> I am using the following code to write the plot to an eps format
>>>
>>> postscript(file="test.eps",horizontal=FALSE)
>>>
>>> boxplot
>>> (test
>>> [30,1
>>> :
>>> 500
>>> ],test
>>> [90,1
>>> :
>>> 500
>>> ],test
>>> [150,1
>>> :
>>> 500
>>> ],test
>>> [210,1
>>> :
>>> 500
>>> ],test
>>> [270,1
>>> :
>>> 500
>>> ],test
>>> [330,1
>>> :
>>> 500
>>> ],test
>>> [390,1
>>> :
>>> 500
>>> ],names
>>> =
>>> c
>>> ("1
>>> ","3
>>> ","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y",
>>> xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars
>>> =list(whisklwd=0,staplelwd=0))
>>>
>>> dev.off()
>>>
>>>
>>> This creates a 6kb eps file, that can not be opened by any
>>> program. I tired with photoshop gimp, acrobat reader. This is the
>>> normal process I follow to save my plots.
>>>
>>> dev.off always returns 1.
>>>
>>> and the boxplot function succesfullu does the plot in the screen.
>>>
>>> What might be the problem?
>>>
>>> I would like to thank you in advance for your help
>>>
>>> B.R
>>> Alex
>>
>>
>>
>> You did not create an EPS file. See ?postscript and pay attention
>> to the fourth paragraph under Details:
>>
>> The postscript produced for a single R plot is EPS (Encapsulated
>> PostScript) compatible, and can be included into other documents,
>> e.g., into LaTeX, using \includegraphics{<filename>}. For use in
>> this way you will probably want to use setEPS() to set the defaults
>> as horizontal = FALSE, onefile = FALSE, paper = "special". Note
>> that the bounding box is for the device region: if you find the
>> white space around the plot region excessive, reduce the margins of
>> the figure region viapar(mar=).
>>
>>
>> HTH,
>>
>> Marc Schwartz
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD
West Hartford, CT
Sometimes when I have a script that does not close out a graphics device correctly (using PDF), I sometimes have problems opening up the file. I use the following command to make sure all graphics devices are closed before generating plots after a script has not terminated correctly: graphics.off() Try this command before generating your plots.
On Fri, Aug 19, 2011 at 8:06 AM, Alaios <alaios at yahoo.com> wrote:
Dear Marc,
I would like to thank you for your answer.
Unfortunately still
setEPS()
postscript(file="exponcoverapprox.eps")
boxplot(test[30,1:500],exponper[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","15"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "Xlabel",ylab="Ylabel,boxwex=0.5,pars=list(whisklwd=0,staplelwd=0) )
dev.off()
still does not work, though the
setEPS()
postscript(file="exponcoverapprox.eps")
boxplot(test[30,1:500],exponper[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","15"),outline=FALSE,ylim=c(0.01,50),log="y",
?xlab =
"Xlabel",ylab="Ylabel,boxwex=0.5)
dev.off()
works fine! It seems that the problem is with the pars=list(.
Just to make it more clear. The dev.off() returns 1 and the file is created. The problem is that this file can not be open with any program, while all the other .eps files I have and were created by R, with the above methodology work really nice.
B.R
Alex
________________________________
From: Marc Schwartz <marc_schwartz at me.com>
Cc: "R-help at r-project.org" <R-help at r-project.org>
Sent: Wednesday, August 17, 2011 5:48 PM
Subject: Re: [R] postscript( does not save the plot
Not sure what output you get in the first case. You don't need:
? ps.options=setEPS()
just:
? setEPS()
Using:
set.seed(1)
test <- matrix(runif(500*500), 500)
setEPS()
postscript(file = "exponcoverapprox.eps")
boxplot(test[30, 1:500], test[90, 1:500], test[150, 1:500], test[210, 1:500],
? ? ? ? test[270, 1:500], test[330, 1:500], test[390, 1:500],
? ? ? ? names = c("1", "3", "5", "8", "10", "13", "1"), outline = FALSE,
? ? ? ? ylim=c(0.01, 50), log = "y", xlab = "xvalue", ylab = "yvalue",
? ? ? ? boxwex=0.5, pars = list(whisklwd = 0, staplelwd = 0))
dev.off()
I get the attached output which seems to be OK.
Marc
On Aug 17, 2011, at 10:02 AM, Alaios wrote:
The problem is a bit weird.
This does not work:
ps.options=setEPS()
postscript(file="exponcoverapprox.eps")
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars
=list(whisklwd=0,staplelwd=0))
dev.off()
This works
postscript(file="exponcoverapprox.eps")
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5)
dev.off()
To not bother you with the details, the only difference is the pars
=list(whisklwd=0,staplelwd=0) at the end of the boxplot , which I use to remove the whiskers fromt he blot.
B.R
________________________________
From: Marc Schwartz <marc_schwartz at me.com>
Cc: "R-help at r-project.org" <R-help at r-project.org>
Sent: Tuesday, August 16, 2011 7:38 PM
Subject: Re: [R] postscript( does not save the plot
On Aug 16, 2011, at 12:32 PM, Alaios wrote:
Dear all,
I am using the following code to write the plot to an eps format
postscript(file="test.eps",horizontal=FALSE)
boxplot(test[30,1:500],test[90,1:500],test[150,1:500],test[210,1:500],test[270,1:500],test[330,1:500],test[390,1:500],names=c("1","3","5","8","10","13","1"),outline=FALSE,ylim=c(0.01,50),log="y", xlab = "xvalue",ylab="yvalue",boxwex=0.5, pars =list(whisklwd=0,staplelwd=0))
dev.off()
This creates a 6kb eps file, that can not be opened by any program. I tired with photoshop gimp, acrobat reader. This is the normal process I follow to save my plots.
dev.off always returns 1.
and the boxplot function succesfullu does the plot in the screen.
What might be the problem?
I would like to thank you in advance for your help
B.R
Alex
You did not create an EPS file. See ?postscript and pay attention to the fourth paragraph under Details:
The postscript produced for a single R plot is EPS (Encapsulated PostScript) compatible, and can be included into other documents, e.g., into LaTeX, using \includegraphics{<filename>}. For use in this way you will probably want to use setEPS() to set the defaults as horizontal = FALSE, onefile = FALSE, paper = "special". Note that the bounding box is for the device region: if you find the white space around the plot region excessive, reduce the margins of the figure region viapar(mar=).
HTH,
Marc Schwartz
? ? ? ?[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Jim Holtman Data Munger Guru What is the problem that you are trying to solve?
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110819/566acc00/attachment.pl>
On Aug 19, 2011, at 9:08 AM, Alaios wrote:
Dear al, I would like to thank you for your replies. I have tried with graphics.off() but did not help too. I am also sorry that my example was not reproducible
It has never been reproducible because you have ignored the request 3 days ago to supply the 'test' object. You have also ignores the request that you post sessionInfo()
David Winsemius, MD West Hartford, CT