Greetings-
I have a strange problem displaying a graph from R (1.3.1, linux) in a
LaTeX document of documentclass seminar.
I'm using graphicx to include the file:
\usepackage{graphicx}
...
\resizebox{\textwidth}{\textheight}{\includegraphics{crime.eps}}
When I do this, the entire slide (including the page number) is rotated
180 degrees. Any ideas why this happens?
The graph was created using the syntax in R:
data(USArrests)
postscript(file="crime.eps")
plot(USArrests$Murder, USArrests$Assault)
abline(lm(USArrests$Assault ~ USArrests$Murder))
dev.off()
Thanks for any advice. This is rather urgent, as I'm trying to use it for
a lecture in my class Monday morning.
ap
----------------------------------------------------------------------
Andrew J Perrin - andrew_perrin at unc.edu - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Andrew Perrin wrote:> > Greetings- > > I have a strange problem displaying a graph from R (1.3.1, linux) in a > LaTeX document of documentclass seminar. > > I'm using graphicx to include the file: > > \usepackage{graphicx} > > ... > > \resizebox{\textwidth}{\textheight}{\includegraphics{crime.eps}} > > When I do this, the entire slide (including the page number) is rotated > 180 degrees. Any ideas why this happens? > > The graph was created using the syntax in R: > > data(USArrests) > postscript(file="crime.eps") > plot(USArrests$Murder, USArrests$Assault) > abline(lm(USArrests$Assault ~ USArrests$Murder)) > dev.off() > > Thanks for any advice. This is rather urgent, as I'm trying to use it for > a lecture in my class Monday morning.Two solutions (not tested): 1 - Use postscript(..., horzontal = FALSE) (maybe you have to adjust width and height) for details see ?postscript 2 - generate a bounding box, so the page will still be horizontal. Uwe -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I'm not entirely sure what the problem is, but either of these
(but not both) might help:
1. \includegraphics[angle=-90]{crime.eps}
2. postscript(file = "crime.eps", horizontal = FALSE)
--- Andrew Perrin <andrew_perrin at unc.edu>
wrote:> Greetings-
>
> I have a strange problem displaying a graph from R (1.3.1, linux) in a
> LaTeX document of documentclass seminar.
>
> I'm using graphicx to include the file:
>
> \usepackage{graphicx}
>
> ...
>
> \resizebox{\textwidth}{\textheight}{\includegraphics{crime.eps}}
>
> When I do this, the entire slide (including the page number) is rotated
> 180 degrees. Any ideas why this happens?
>
> The graph was created using the syntax in R:
>
> data(USArrests)
> postscript(file="crime.eps")
> plot(USArrests$Murder, USArrests$Assault)
> abline(lm(USArrests$Assault ~ USArrests$Murder))
> dev.off()
>
> Thanks for any advice. This is rather urgent, as I'm trying to use it
for
> a lecture in my class Monday morning.
>
> ap
>
> ----------------------------------------------------------------------
> Andrew J Perrin - andrew_perrin at unc.edu - http://www.unc.edu/~aperrin
> Assistant Professor of Sociology, U of North Carolina, Chapel Hill
> 269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA
>
>
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
__________________________________________________
Great stuff seeking new owners in Yahoo! Auctions!
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>I have a strange problem displaying a graph from R (1.3.1, linux) in a >LaTeX document of documentclass seminar. > >I'm using graphicx to include the file: > >\usepackage{graphicx} > >... > >\resizebox{\textwidth}{\textheight}{\includegraphics{crime.eps}} > >When I do this, the entire slide (including the page number) is rotated >180 degrees. Any ideas why this happens? > >The graph was created using the syntax in R: > >data(USArrests) >postscript(file="crime.eps") >plot(USArrests$Murder, USArrests$Assault) >abline(lm(USArrests$Assault ~ USArrests$Murder)) >dev.off()Since it is urgent, I will attempt to answer, despite the risk of being wrong. You could try dev.copy2eps: `dev.copy2eps' is similar to `dev.print' but produces an EPSF output file, in portrait orientation (`horizontal = FALSE') I think you can just use this command, and follow it with dev.off(). Then I recall you have to rename the resulting output to crime.eps. You might also try adding horiz=F to your postscript command. You could also try \includegraphics[angle=90]{crime.eps} or angle=-90, or whatever. And I think you could also use graphicx commands instead of resize... For example, \includegraphics[angle=90,width=\textwidth]{crime.eps} (I would let the height define itself.) Jon Jon Baron -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Both R and latex can twist plots around some. I usually explicitly indicate
the orientation in R via the horizontal switch on the postscript command.
postscript("estimate.ps",height=4, width=6, horizontal=F)
You can also rotate graphs around in latex thusly,
\rotatebox{0}{\resizebox{10cm}{!}{\includegraphics{DeComExtrems.ps}}}
The first arguement of the rotatebox command is the degree to rotate.
Michaell
Andrew Perrin wrote:> Greetings-
>
> I have a strange problem displaying a graph from R (1.3.1, linux) in a
> LaTeX document of documentclass seminar.
>
> I'm using graphicx to include the file:
>
> \usepackage{graphicx}
>
> ...
>
> \resizebox{\textwidth}{\textheight}{\includegraphics{crime.eps}}
>
> When I do this, the entire slide (including the page number) is rotated
> 180 degrees. Any ideas why this happens?
>
> The graph was created using the syntax in R:
>
> data(USArrests)
> postscript(file="crime.eps")
> plot(USArrests$Murder, USArrests$Assault)
> abline(lm(USArrests$Assault ~ USArrests$Murder))
> dev.off()
>
> Thanks for any advice. This is rather urgent, as I'm trying to use it
for
> a lecture in my class Monday morning.
>
> ap
>
> ----------------------------------------------------------------------
> Andrew J Perrin - andrew_perrin at unc.edu - http://www.unc.edu/~aperrin
> Assistant Professor of Sociology, U of North Carolina, Chapel Hill
> 269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>.-.- r-help mailing list -- Read
> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info",
"help", or
> "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>._._
--
========================================Michaell Taylor, PhD
Senior Economist, Reis, New York, USA
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Andrew,
Try something like:
\includegraphics[height=5in,width=4in,angle=-90]{crime.eps}
jason
Andrew Perrin wrote:>
> Greetings-
>
> I have a strange problem displaying a graph from R (1.3.1, linux) in a
> LaTeX document of documentclass seminar.
>
> I'm using graphicx to include the file:
>
> \usepackage{graphicx}
>
> ...
>
> \resizebox{\textwidth}{\textheight}{\includegraphics{crime.eps}}
>
> When I do this, the entire slide (including the page number) is rotated
> 180 degrees. Any ideas why this happens?
>
> The graph was created using the syntax in R:
>
> data(USArrests)
> postscript(file="crime.eps")
> plot(USArrests$Murder, USArrests$Assault)
> abline(lm(USArrests$Assault ~ USArrests$Murder))
> dev.off()
>
> Thanks for any advice. This is rather urgent, as I'm trying to use it
for
> a lecture in my class Monday morning.
>
> ap
>
> ----------------------------------------------------------------------
> Andrew J Perrin - andrew_perrin at unc.edu - http://www.unc.edu/~aperrin
> Assistant Professor of Sociology, U of North Carolina, Chapel Hill
> 269 Hamilton Hall, CB#3210, Chapel Hill, NC 27599-3210 USA
>
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
Jason Martinez
Sociology Graduate Student
University of California, Riverside
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._