Well since I'm new here I can't post the image that would make this a whole lot easier.
Essentially, I have 45 pairs of bars in a barplot. Each group of 5 pairs belongs to a different city. What I want to do is only show one name for each group of 5 and not show any repeats.
The code I have so far is:
barplot(matrix(c(sixth_shop, thirteenth_shop), nrow=2, ncol=45, byrow=T),
beside=T, legend.text=c('6th Shoppers', '13th Shoppers'), ylim = c(0, 11000),
col = c('light green', 'navy'), ylab = 'Number of Shoppers', main = 'Total Shoppers',
names.arg = raw_data$Location)
barplot(c(1, 2, 3, 4, 2), names.arg = c('cow', 'horse', 'pig', 'raccoon', 'butterfly'))
| X X
| X X X X
Just separate the plotting the the labeling.
barpos <- barplot(c(1, 2, 3, 4, 2)) axis(1, at=barpos, labels=("pig"))
The x value where each bar is drawn is returned from