An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110612/87e4cf65/attachment.pl>
R graphs differ from exported one
5 messages · Massimiliano Tripoli, Joshua Wiley, Mark Seeto +1 more
Hmm, did you shut the device down afterward (i.e., call dev.off() )?
I do not have any logic why that would induce the behavior you say you
are getting, but this works just fine for me:
postscript("tmp.eps", onefile = TRUE)
qqnorm(rnorm(20))
dev.off()
and creates the attached file (possibly not attached for the list, but
you should get it).
Josh
On Sun, Jun 12, 2011 at 10:00 AM, Massimiliano <massi.lyons at gmail.com> wrote:
Hello everybody! This is my first mail so I'll write a couple of lines
of self-introduction.
My name is Massimiliano, I'm from Italy and I'm studying Mathematical
Engineering.
I started using R in my Statistics course and have to use it to make a
project which I'll discuss at the end of the course.
The problem I'd like to ask you about follows.
Suppose I have imported a datafile with the classic command
dat <- read.table('file', header=T)
and wanted to see if my data are Normal-like or not.
I can accomplish this with the command
qqnorm (col)
where 'col' is the column in the datafile 'file'.
Now, the graph that appears is very nice: indeed it has a title, two
axes with their labels and all the rest;
but when I give commands
postscript(file="plot.eps", onefile=FALSE)
qqnorm (col)
to save the graph to a file "plot.eps" to include it in a TeX, the file
created has nothing to do with the former one: it only has "the graph
part", i.e. no title, no labels, no axes....
I searched in the documentation but found nothing; the same on the
forum.
What should I do?
I'm running R 2.12.1 on Ubuntu Linux 10.04 LL 64-bit
Thanks for help to everybody :)
Massimiliano
? ? ? ?[[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.
Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: tmp.eps Type: application/postscript Size: 7407 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110612/e562c078/attachment.eps>
Raptorista wrote:
Now, the graph that appears is very nice: indeed it has a title, two axes with their labels and all the rest; but when I give commands postscript(file="plot.eps", onefile=FALSE) qqnorm (col) to save the graph to a file "plot.eps" to include it in a TeX, the file created has nothing to do with the former one: it only has "the graph part", i.e. no title, no labels, no axes....
I use R under Windows, and I've seen the same sort of thing. I usually save graphs as PDF or PNG files, which works fine, but on the rare occasions I've tried to save graphs as Postscript, some of the graphs end up saving with bits missing. -- View this message in context: http://r.789695.n4.nabble.com/R-graphs-differ-from-exported-one-tp3592553p3592915.html Sent from the R help mailing list archive at Nabble.com.
Usually this happens when you forget to run dev.off(), as in that
example.
But we don't have the
commented, minimal, self-contained, reproducible code.
the posting guide and the footer of every R message asks for.
On Sun, 12 Jun 2011, Mark Seeto wrote:
Raptorista wrote:
Now, the graph that appears is very nice: indeed it has a title, two axes with their labels and all the rest; but when I give commands postscript(file="plot.eps", onefile=FALSE) qqnorm (col) to save the graph to a file "plot.eps" to include it in a TeX, the file created has nothing to do with the former one: it only has "the graph part", i.e. no title, no labels, no axes....
I use R under Windows, and I've seen the same sort of thing. I usually save graphs as PDF or PNG files, which works fine, but on the rare occasions I've tried to save graphs as Postscript, some of the graphs end up saving with bits missing. -- View this message in context: http://r.789695.n4.nabble.com/R-graphs-differ-from-exported-one-tp3592553p3592915.html Sent from the R help mailing list archive at Nabble.com.
______________________________________________ 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.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
I didn't include code because I wasn't asking for help; I was merely commenting that I had seen the same thing happen. But thank you for mentioning dev.off, which I had not heard of before. On Mon, Jun 13, 2011 at 3:55 PM, Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote:
Usually this happens when you forget to run dev.off(), as in that example. But we don't have the ? commented, minimal, self-contained, reproducible code. the posting guide and the footer of every R message asks for. On Sun, 12 Jun 2011, Mark Seeto wrote:
Raptorista wrote:
Now, the graph that appears is very nice: indeed it has a title, two axes with their labels and all the rest; but when I give commands postscript(file="plot.eps", onefile=FALSE) qqnorm (col) to save the graph to a file "plot.eps" to include it in a TeX, the file created has nothing to do with the former one: it only has "the graph part", i.e. no title, no labels, no axes....
I use R under Windows, and I've seen the same sort of thing. I usually save graphs as PDF or PNG files, which works fine, but on the rare occasions I've tried to save graphs as Postscript, some of the graphs end up saving with bits missing. -- View this message in context: http://r.789695.n4.nabble.com/R-graphs-differ-from-exported-one-tp3592553p3592915.html Sent from the R help mailing list archive at Nabble.com.
______________________________________________ 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.
-- Brian D. Ripley, ? ? ? ? ? ? ? ? ?ripley at stats.ox.ac.uk Professor of Applied Statistics, ?http://www.stats.ox.ac.uk/~ripley/ University of Oxford, ? ? ? ? ? ? Tel: ?+44 1865 272861 (self) 1 South Parks Road, ? ? ? ? ? ? ? ? ? ? +44 1865 272866 (PA) Oxford OX1 3TG, UK ? ? ? ? ? ? ? ?Fax: ?+44 1865 272595