[R] Plotting Notched Box Plots Log Scale - Losing bottom portion of box plot

Bert Gunter bgunter.4567 at gmail.com
Wed Mar 21 21:48:31 CET 2018


Note that:

> plot(Iron~Location,data=MyDataIron,log="y",notch=FALSE)
> plot(10+Iron~Location,data=MyDataIron,log="y",notch=TRUE)
Warning message:
In bxp(list(stats = c(10.66, 13.9, 24.9, 39, 60, 10.05, 10.07515,  :
  some notches went outside hinges ('box'): maybe set notch=FALSE

## Both work, but:

> plot(Iron~Location,data=MyDataIron,log="y",notch=TRUE)
Error in plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs)
:
  Logarithmic axis must have positive limits

So the problem is some of your notches want to extend to negative values.
Limiting the y range can't help: the notches can't be plotted on a log
scale.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Wed, Mar 21, 2018 at 12:52 PM, David Doyle <kydaviddoyle at gmail.com>
wrote:

> Hello,
>
> I'm using the code below to generate some notched box plots.  The issue is
> whenever I use log scale, the sides of the bottom part of the box plots
> don't plot.  I've tried it in RStudio Ver 1.1.419 and R version 3.4.3 and I
> get the same result.
>
> The code and link to my data is below.
>
> Thank you for your time
> David
>
>
>
> MyData <- read.table("http://doylesdartden.com/ExampleIron.CSV",
> header=TRUE, sep=",")
>
> MyDataIronx <- c("Location", "Iron")
>
> MyDataIron <- MyData[MyDataIronx]
>
> plot(MyDataIron, notch=TRUE,log = "y",ylim=c(0.01, 100))
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list