Clipping does not seem to affect barplot()
-- ??
par(xpd=F); barplot(1:60, ylim=c(0,6)); segments(0,0,200,100, lwd=5)
The line segment is clipped at y=6
, but the barplot goes to the top of the page!
I just upgraded (Fire Safety, 3.2.2 (2015-08-14) on a mac); I tried using the quartz device and also using a pdf device -- same error. Works fine if I use plot()
instead of barplot()
.
Does anyone else have this error? Any explanations or workarounds?
Thanks!
larry
barplot
has an xpd
argument, which is overriding the setting in par
. From ?graphics::barplot
## Default S3 method: barplot(height, width = 1, space = NULL, names.arg = NULL, legend.text = NULL, beside = FALSE, horiz = FALSE, density = NULL, angle = 45, col = NULL, border = par("fg"), main = NULL, sub = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, xpd = TRUE, log = "", axes = TRUE, axisnames = TRUE, cex.axis = par("cex.axis"), cex.names = par("cex.axis"), inside = TRUE, plot = TRUE, axis.lty = 0, offset = 0, add = FALSE, args.legend = NULL, ...)
....
xpd: logical. Should bars be allowed to go outside region?
This works, for example,
barplot(1:60, ylim=c(0,6), xpd = FALSE)