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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

kydaviddoyle
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]]

______________________________________________
[hidden email] 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.
Take Care

David Doyle
Reply | Threaded
Open this post in threaded view
|

Re: Plotting Notched Box Plots Log Scale - Losing bottom portion of box plot

Bert Gunter-2
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 <[hidden email]>
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]]
>
> ______________________________________________
> [hidden email] 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]]

______________________________________________
[hidden email] 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.