From c@g|||e@p|e @end|ng |rom gm@||@com  Fri May 17 11:56:50 2019
From: c@g|||e@p|e @end|ng |rom gm@||@com (Colin Gillespie)
Date: Fri, 17 May 2019 10:56:50 +0100
Subject: [Rd] Barplot & Boxplot: lim and horizontal
Message-ID: <CADbDLZ=9RdNmJsi6S9__GDxLHqJOk_t9KJjs+SV0fBYsjgkTSA@mail.gmail.com>

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



[Rd] Barplot & Boxplot: lim and horizontal
Colin Gillespie