hello, i can't figure out how to change the vertical position of my x axis labels.. boxplot(c(1:12)~c(rep("1",6),rep("2",6)),at=c(1,2), col=c(0,"grey"),las=1,xaxt="n") ### i put paragraphs in the x-labels because of limited horizontal space axis(1,at=c(1,2),adj=1,labels=c("Salix Scrub","Tall Forb")) ...the labels are one line above usual position and cross the tickmarks and i don't know how to get around this. can anyone help with this? thanks in advance. kay -- View this message in context: http://n4.nabble.com/boxplot-vertical-position-of-x-axis-labels-tp1594857p1594857.html Sent from the R help mailing list archive at Nabble.com.
On Mar 16, 2010, at 9:37 AM, Kay Cichini wrote:> > hello, > > i can't figure out how to change the vertical position of my x axis > labels.. > > boxplot(c(1:12)~c(rep("1",6),rep("2",6)),at=c(1,2), > col=c(0,"grey"),las=1,xaxt="n") > > ### i put paragraphs in the x-labels because of limited horizontal > space >?axis Try using the padj argument (and it bothered me to use the <cr>'s rather than "\n", so I modified the labels argument as well): axis(1,at=c(1,2),adj=1,padj=0.5,labels=c("Salix\nScrub","Tall\nForb"))> > > ...the labels are one line above usual position and cross the > tickmarks and > i don't know how to get around this. > > can anyone help with this? > thanks in advance.-- David Winsemius, MD West Hartford, CT
Hi r-help-bounces at r-project.org napsal dne 16.03.2010 14:37:01:> > hello, > > i can't figure out how to change the vertical position of my x axislabels..> > boxplot(c(1:12)~c(rep("1",6),rep("2",6)),at=c(1,2), > col=c(0,"grey"),las=1,xaxt="n") > > ### i put paragraphs in the x-labels because of limited horizontal space > > axis(1,at=c(1,2),adj=1,labels=c("Salix > Scrub","Tall > Forb")) > > ...the labels are one line above usual position and cross the tickmarksand> i don't know how to get around this. >Not sure if it is the only way but # first put only labels axis(1,at=c(1,2),adj=1, tick=F, line=2,labels=c("Salix Scrub","Tall Forb")) # add axis without labels axis(1,at=c(1,2),adj=1, tick=T,labels=c(NA, NA)) Regards Petr> can anyone help with this? > thanks in advance. > > kay > -- > View this message in context:http://n4.nabble.com/boxplot-vertical-position-> of-x-axis-labels-tp1594857p1594857.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
thanks a lot! both ways work. greetings - kay -- View this message in context: http://n4.nabble.com/boxplot-vertical-position-of-x-axis-labels-tp1594857p1596456.html Sent from the R help mailing list archive at Nabble.com.