简体   繁体   English

Latex Sweave R-页面本身正在旋转

[英]Latex Sweave R - page is rotating by itself

I am new to using Sweave with Latex, and am having some small troubles. 我是Sweave和Latex的新手,遇到了一些小麻烦。 Here is the segment of the document put into it's own tex file. 这是放入其自己的tex文件中的文档片段。

\documentclass[a4paper,10pt]{article}
\usepackage[dvips]{graphicx}
\usepackage{Sweave}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                 END PREAMBLE                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}
\pagestyle{plain}

    \begin{figure}
    \begin{center}
<<fig=TRUE,echo=FALSE>>=
data=read.table("adult_dataset/adult.data", sep=",");

age=c(t(data[1]));
fnlwgt=c(t(data[3]));
education_num=c(t(data[5]));
cap_gain=c(t(data[11]));
cap_loss=c(t(data[12]));
hrs_week=c(t(data[13]));

labels=c("Age", "Final weight", "Education num", "Capital gain", "Capital loss", "Hours per week");

dframe=data.frame(age, fnlwgt, education_num, cap_gain, cap_loss, hrs_week);

par(mfrow=c(2,3)); 

for (i in c(1:6) ){
boxplot(dframe[i], main=labels[i]);
}
@
      \label{fig:boxplots}
      \caption{Boxplots of numerical features}
    \end{center}
    \end{figure}

\end{document}

adult.data is http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data I compile with: adult.data是http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data,我使用以下方法进行编译:

R CMD Sweave test.rnw && latex test.tex && dvipdf test.dvi

This produced a page which is horizontal. 这产生了一个水平的页面。 It is the correct size, but it is rotated 90 degrees. 这是正确的尺寸,但已旋转90度。 Not the picture, but the whole page. 不是图片,而是整个页面。

What can I do to fix this? 我该怎么做才能解决此问题? Is this normal behavior? 这是正常行为吗?

Thank you for any suggestions :) 谢谢您的任何建议:)

dvipdf -dAutoRotatePages=/None test.dvi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM