TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 dev.off() 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 yihui.name/knitr or the manual github.com/downloads/yihui/knitr/knitr-manual.pdf – 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.