Skip to content
Prev 255726 / 398506 Next

gap.barplot doesn't support data arrays?

I am trying to make a barplot with a broken axis using gap.barplot (in the
indispensable plotrix package).  This works well when the data is a vector:
values",main="Barplot with gap")

But when the data is an array (for a bar plot with multiple series) I get an
error and a strange plot with no y-tics and bars stretching downwards, as if
all the values were negative:
gap.barplot(twogrp2,gap=c(8,16),xlab="Index",ytics=c(3,6,17,20),ylab="Group
values",main="Barplot with gap")

Error in rect(xtics[bigones] - halfwidth, botgap, xtics[bigones] +
halfwidth,  : 
  cannot mix zero-length and non-zero-length coordinates

However, the main title and axis labels do appear correctly.

Are data arrays unsupported for gap.barplot, or am I missing something?

Thanks,
Drew Steen