[R] white lines in barplot
Dear R-helpers, I would like to draw white lines in my barplots to improve the visualization. I include an example: barplot(sample(1:100,15),width=0.59,horiz=T,col=steelblue,border=NA,axes=F,ylim=c(0,10),xlim=c(0,100)) abline(v = seq(10, zehnind, by = 10), col = white) axis(1,at=ticks,las=1,labels=paste(ticks,%,sep=)) my problem is, that the white lines are not long enough at the top. I also tried the function lines and asix, which didn't work either, neither did changing the ylim. Does somebody know how to do this? Marion [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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.
Re: [R] white lines in barplot
On 05/09/2012 07:12 PM, Marion Wenty wrote: Dear R-helpers, I would like to draw white lines in my barplots to improve the visualization. I include an example: barplot(sample(1:100,15),width=0.59,horiz=T,col=steelblue,border=NA,axes=F,ylim=c(0,10),xlim=c(0,100)) abline(v = seq(10, zehnind, by = 10), col = white) axis(1,at=ticks,las=1,labels=paste(ticks,%,sep=)) my problem is, that the white lines are not long enough at the top. I also tried the function lines and asix, which didn't work either, neither did changing the ylim. Hi Marion, Try this: ... par(xpd=TRUE) abline(v = seq(10, zehnind, by = 10), col = white) par(xpd=FALSE) ... Jim __ R-help@r-project.org mailing list 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.
Re: [R] white lines in barplot
Yes, this worked! Thank you very much!! Marion 2012/5/9 Jim Lemon j...@bitwrit.com.au On 05/09/2012 07:12 PM, Marion Wenty wrote: Dear R-helpers, I would like to draw white lines in my barplots to improve the visualization. I include an example: barplot(sample(1:100,15),**width=0.59,horiz=T,col=** steelblue,border=NA,axes=F,**ylim=c(0,10),xlim=c(0,100)) abline(v = seq(10, zehnind, by = 10), col = white) axis(1,at=ticks,las=1,labels=**paste(ticks,%,sep=)) my problem is, that the white lines are not long enough at the top. I also tried the function lines and asix, which didn't work either, neither did changing the ylim. Hi Marion, Try this: ... par(xpd=TRUE) abline(v = seq(10, zehnind, by = 10), col = white) par(xpd=FALSE) ... Jim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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.