Last active
December 29, 2018 11:16
-
-
Save Mahedi-61/53ab717f751bdc2d0e216916216cc591 to your computer and use it in GitHub Desktop.
creating group bar chart using r for research publication.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setEPS() | |
postscript("example.eps") | |
nm=c(98.45, 97.58, 98.75, 96.92, 99.41) | |
bag=c(56.23, 72.14, 72.73, 85.78, 87.10) | |
coat=c(16.93, 45.45, 41.50, 68.11, 55.13) | |
data=matrix(c(nm,bag,coat), ncol=3) | |
colnames(data)=c("normal", "bag", "coat") | |
rownames(data)=c("GEI+PCA", "SPAE", "GaitGAN", "PTSN", "Proposed") | |
par(mar=c(8, 4, 8, 2)) # where arguments are (b, l, t, r) | |
xx = barplot(data, col=c("cyan", "gold", "green", "purple", "blue"), | |
border="white", beside = T, space=c(0.4, 3), ylim=c(0,115), axes = TRUE, | |
width = c(1, 1, 1, 1, 1), ylab="Average Recognition Rate (%)") | |
legend("topright", | |
legend=rownames(data), | |
fill = c("cyan", "gold", "green", "purple", "blue"), | |
ncol = 2, | |
cex = 0.75) | |
grid(nx=NA, ny=NULL, col = "black") | |
text(x = xx + 0.5, y = data + 2, label = data, pos = 3, cex = 1, srt = 60, adj= 1, xpd=TRUE, col = "black") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment