[R] Box Plot size and labels

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Mon Oct 27 03:27:30 CET 2014


Your code uses the default graphics output device (most likely the windows() device, guessing from your use of MSWord). The png() device might produce more consistent results. Since you are using RMarkdown, you may be using knitr which has chunk options that can be used to control the device used and its graphic properties.

See

?png
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On October 26, 2014 6:49:48 PM PDT, David Doyle <kydaviddoyle at gmail.com> wrote:
>Hello,
>
>I'm doing some box plots in Rmarkdown to MS Word file.  When they come
>into
>the word file they are not quite wide enough for labels for the
>different
>boxes.  Is there a way for me to set the size the box plot would be so
>I
>can make it wider?
>
>Or reduce the font size so they can all fit on the graph??
>
>My data and code are below
>
>Thank you for your time.
>David Doyle
>
>MS <- read.table("http://www.doylesdartden.com/R/MS.csv", header=TRUE,
>sep=",",)
>
>#Sets whic are detections and nondetects
>MS$Detections <- ifelse(MS$D_AMMONIA==1, "Detected", "NonDetect")
>
>MSAmmoniax <- c("Well", "AMMONIA")
>MSAmmonia <- MS[MSAmmoniax]
>
>plot(MSAmmonia, notch=TRUE, ylab = "Ammonia (mg/L)", cex = 0.1,
>col=(c("green","white")))
>legend("topleft", inset=.002, title="Gradient",
>       c("Up","Down"), fill=terrain.colors(2), horiz=TRUE, cex = 0.7,)
>title(main="Lower Mudstone Ammonia Box Plots")
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list