2

I am a newbie to R and LaTeX, and cannot find any hint for my problem. Perhaps it is a silly question, but I tried to get a R-diagram into my LaTeX document without the axes out of focus.

So far so good, in R I used the following notation:

BoxPDT<-ggplot(dat,aes(Anforderung,Beanspruchung,fill=Anforderung))+geom_boxplot()+facet_grid(.~Lauf)+theme(axis.text.x=element_text(angle=90,size=16,vjust=0.5),axis.title=element_text(size=20,vjust=0.5),axis.text.y=element_text(size=16,vjust=0.5),legend.position="none")+
theme(axis.text=element_text(family="mono",face="bold"))
dev.copy(jpeg, "C:/Users/name/Documents/D/AStlich/Latex/Bilder/BoxPDT.jpeg")

Then I put it in LaTeX via

\begin{figure} \begin{center} \includegraphics[width=0.75\textwidth]{C:/Users/name/Documents/D/A/S/Latex/Bilder/BoxPDT} \label{fig:BoxPDT} \caption{Boxplot der NASA TLX Auswertung über die einzelnen Parametrierungsschritte (1-3). Wobei 1 für ..., 2 für... und 3 für ... steht.} \end{center} \end{figure} \end{figure}

but all I get is a cloudy and diffuse picture. Strictly speaking just the axes are cloudy and diffuse.

That is, what my latex editor shows after including the figure.

As you can see, the text of the figure is much cloudy as the text of the written text beneath. Moreover, the distance between axes text and axes titles is very small.

I would apprciate for some hints and please excuse my bumpy English.

Sverre
  • 20,729
Kaddi
  • 21
  • 2
    It is generally not a good idea to save gfx as jpg especially when you are scaling it afterwards. I do not know much about R, but you should be able to generate eps or pdf output (if it is only eps, then use epstopdf to convert it to pdf afterwards. – daleif May 07 '14 at 12:31
  • As daleif says, you should use vector image formats in R (eps, pdf, svg) to avoid "blurriness" when importing them into other programs. Since this is an R and not a TeX question, I'm voting to close. – Sverre May 07 '14 at 12:55

0 Answers0