I am trying to create a barplot with R with different widths of bars and different spaces between them. For example, I have a matrix
data <- matrix(c(1,2,2,4,7,1,11,12,3), ncol = 3, byrow = T) colnames(data) <- c("Start", "Stop", "Height")
And I would like to create such a figure (sorry for the sketch):
| __ | __ | | | | | ________ | | | | | | | | | ------------------- ------------------ 0 1 2 3 4 5 6 7 8 9 10 11 12
As far as I understand, barplot () allows you to specify the width, but the space between the columns can only be expressed as part of the average width of the strip. However, I would like to specify specific (integer) numbers for spaces between columns. I will be grateful for any tips / ideas!
source share