I am using knitr
, ggplot
. I want a plot like this:
to be shown better. But I still get something like this:
\begin{landscape}
<< mygrah2>>=
require(ggplot2)
ggplot(T2,aes(x=age,y=value,fill=Position))
+geom_boxplot()+ggtitle("Distribuition of frequencies per age in 3
collected positions.\n N=1000,K=10,T=2")+theme(legend.position="bottom")
@
\end{landscape}
I already try options out.width
, fig.width
but not working.
Edit:
I am sure that I'm using knitr. I did an example below. As @Thierry sad the solution is use a fig.height AND fig.width together. Thanks very much.
\documentclass[letterpaper,12pt]{article}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage[brazil]{babel}
\usepackage{color}
\usepackage{placeins}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{lscape}
\usepackage{fullpage}
\usepackage{pdflscape}
\begin{document}
<<readdata>>=
data(mtcars)
mtcars$gear <- factor(mtcars$gear,levels=c(3,4,5),
labels=c("3gears","4gears","5gears"))
mtcars$cyl <- factor(mtcars$cyl,levels=c(4,6,8),
labels=c("4cyl","6cyl","8cyl"))
require(ggplot2)
@
\begin{landscape}
<<migraph>>=
#normal plot
ggplot(mtcars,aes(x=gear,y=mpg,fill=gear))+geom_boxplot()
@
<<migraph2,fig.width=10>>=
# weird
ggplot(mtcars,aes(x=gear,y=mpg,fill=gear))+geom_boxplot()
@
<<migraph3,fig.height=2,fig.width=10>>=
# It is what I looking for
ggplot(mtcars,aes(x=gear,y=mpg,fill=gear))+geom_boxplot()
@
<<migraph4,out.height="2in",out.width="10in">>=
# weird
ggplot(mtcars,aes(x=gear,y=mpg,fill=gear))+geom_boxplot()
@
\end{landscape}
\end{document}