Я пытаюсь создать более четкую ось X на гистограмме, но не знаю, как это сделать. Может ли кто-нибудь помочь, пожалуйста?
С моим текущим кодом я могу нарисовать график с двумя переменными по оси X. Но значение 2 переменных стоит рядом друг с другом, что делает это неясным для читателя. Я хочу иметь каждую строку для каждой переменной по оси X. Это мой текущий код и результат
Мой ожидаемый результат будет следующим: по оси X первая строка равна 0,1, 0,0555 и т. Д., А вторая строка - S1-2, S2-3
mxCarabooda <- structure(c(13.47258, 7.430879, 13.47151, 7.53012, 14.83685,
8.940968, 15.37691, 9.617533), .Dim = c(2L, 4L), .Dimnames = list(
c("ChangeNP", "ChangeNP.1"), c("Sl-2 0.1", "S2-3 0.055",
"S3-4 0.056", "S4-5 0.056")))
mxNeerabup <- structure(c(3.499426, 2.232676, 3.499596, 2.239664, 3.836086,
2.566649, 3.995115, 2.725839), .Dim = c(2L, 4L), .Dimnames = list(
c("ChangeNP", "ChangeNP.1"), c("Sl-2 0.01", "S2-3 0.01",
"S3-4 0.01", "S4-5 0.02")))
mxNowergup <- structure(c(3.5135, 1.700544, 3.513586, 1.710387, 3.850266, 2.034689,
4.009113, 2.194351), .Dim = c(2L, 4L), .Dimnames = list(
c("ChangeNP", "ChangeNP.1"), c("Sl-2 0.02", "S2-3 0.01",
"S3-4 0.02", "S4-5 0.02")))
tiff("barplot.tiff", width=260, height=100, units='mm', res=300)
par(mfrow=c(1,3), mar=c(5, 4, 4, 0.2))
colours <- c("gray63","gray87")
barplot(mxCarabooda, main='Carabooda', ylab='Profit loss ($m)',
xlab='Change in water table at each level of GW cut', beside=TRUE,
col=colours, ylim=c(0,30))
legend('topright', bty="n", legend=c('Loss in GM','Loss in adjusted GM'),
col=c("gray63","gray87"))
barplot(mxNeerabup,main='Neerabup', ylab='',
xlab='Change in water table at each level of GW cut', beside=TRUE,
col=colours, ylim=c(0,30))
legend('topright', bty="n", legend=c('Loss in GM','Loss in adjusted GM'),
col=c("gray63","gray87"), pch=15)
barplot(mxNowergup,main='Nowergup', ylab='',
xlab='Change in water table at each level of GW cut',beside=TRUE,
col=colours, ylim=c(0,30))
legend('topright', bty="n", legend=c('Loss in GM','Loss in adjusted GM'),
col=c("gray63","gray87"), pch=15)
dev.off()
![enter image description here](https://i.stack.imgur.com/TVayA.png)