Barplot & Boxplot: lim and horizontal

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Barplot & Boxplot: lim and horizontal

Colin Gillespie
Dear All,

I've noticed an inconsistency between boxplot & barplot regarding the
interaction between
switching to a horizontal graph and the limits.

par(mfrow = c(2, 2))
boxplot(1:10, xlim = c(0.1, 5), ylim = c(1, 10),
              log = "y", horizontal=FALSE, xlab = "X", ylab = "Y")
axis(1)
# Changing to horizontal, xlim <-> ylim
# log = y is still the y-axis. ylab is still the y-axis
boxplot(1:10, xlim = c(0.1, 5), ylim = c(1, 10), log = "y",
                       horizontal=TRUE, xlab = "X", ylab = "Y")
axis(2)

barplot(2, xlim = c(0.1, 5), ylim = c(0.1, 10),
                  log = "y", horiz=FALSE, xlab = "X", ylab = "Y")
axis(1)
# Changing to horizontal, xlim still refers to xlim
# log = y is still the y-axis. ylab is still the y-axis
barplot(2, xlim = c(0.1, 5), ylim = c(0.1, 10), log = "y",
                horiz=TRUE, xlab = "X", ylab = "Y")
axis(2)

Thanks

Colin

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel