Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How to disable message null device when using R and latex.

<<echo=FALSE ,results=tex>>=
barplot(as.matrix(disease_data),beside=TRUE, col=c("burlywood1 ","orange2"), horiz=TRUE,cex.names=1.0, border ="white")

I have already disable echo but null device is on image. How can i avoid it?

Regards Regards

share|improve this question

1 Answer 1

echo=FALSE only hides the R code; if you want to hide the output, you should use results=hide.

But why do you have to use pdf() and to manually create a PDF plot? This is too awkward. You should leave this job to Sweave.

share|improve this answer
Now i am using sweave but i can not reduce image size that is why i am using includegraphics by passing width and height to control its size. Is there any way to reduce plot size in R? – manish Apr 25 '12 at 2:51
yes, that is one of the tiny reasons which motivated my knitr package, which allows you to control the size of your plots easily; see or the manual – Yihui Apr 25 '12 at 5:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.