[R] bar plot add space to group data

David L Carlson dc@r|@on @end|ng |rom t@mu@edu
Fri Aug 17 16:37:28 CEST 2018


Notice below that your message is substantially scrambled. R-Help is a plain text only list so you should set your email client to produce plain text messages. 

The best place to start is with the manual page for the barplot() function:

?barplot or help(barplot)

You will find the description of the space= argument useful.

----------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77843-4352

-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of citc using disroot.org
Sent: Friday, August 17, 2018 6:56 AM
To: r-help using r-project.org
Subject: [R] bar plot add space to group data

R-users,

Can someone please advise how to improve the code below that was used to produce the graph shown at the following hyperlink (https://chemistryinthecity.neocities.org/content/entry1808.html#17)? The request is to add space between the annual data groups.

barplot(gceac[,3], xlab='year', ylab='percentage of each grade', col=c('aliceblue', 'aquamarine', 'blue', 'chocolate', 'darkgreen', 'firebrick', 'violet'), legend=gceac[1:7,2], args.legend = list(x = 40, y = 30, title='grades'), main='A-level grades, chemistry', beside=T, space=c(0,2), ylim=c(0,30))
years<-c(2014,2015,2016,2017,2018)
mtext(years, side=1, at=c(5, 12, 19, 26, 33)) R-users, Can someone please advise how to improve the code below that was used to produce the graph shown at the following hyperlink (https://chemistryinthecity.neocities.org/content/entry1808.html#17)? The request is to add space between the annual data groups.  barplot(gceac[,3], xlab='year', ylab='percentage of each grade', col=c('aliceblue', 'aquamarine', 'blue', 'chocolate', 'darkgreen', 'firebrick', 'violet'), legend=gceac[1:7,2], args.legend = list(x = 40, y = 30, title='grades'), main='A-level grades, chemistry', beside=T, space=c(0,2), ylim=c(0,30)) years<-c(2014,2015,2016,2017,2018) mtext(years, side=1, at=c(5, 12, 19, 26, 33))

	[[alternative HTML version deleted]]

______________________________________________
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list