[R] Axes origins and labeling

S Ellison S.Ellison at lgc.co.uk
Thu Jul 16 01:53:53 CEST 2009


Since you;re already specifying the axis tick locations for the x-axis
any ylim for y, one way of dealing with it is to give the axes an extra
tick at each end: Instead of 
axis(side=1, at=c(1,2,3,4), labels=gut)
use
axis(side=1, at=0:5, labels=gut)

Similarly for axis(2), use
axis(2, at=seq(0,250,50))

>>> Marlin Keith Cox <marlinkcox at gmail.com> 07/15/09 9:44 PM >>>
I have re-labeled tick marks on the x axis.  The problem is that by
using
axes=FALSE, the axes disappears and when they are called back using
axis(side=1)..etc. the axis on sides 1 and 2 do not meet at the bottom
left
corner of the graph.  I would also like to have the 3rd and 4th axes in
there as well, all meeting in their respective corners.

par(mfrow=c(1,2))
gut<-c("Full", "Empty", "Full", "Empty")
par(family="serif", cex=1.2, lab=c(length(gut),4,4))
boxplot(Xc~Trt,data=error,ylab="Reactance (Ohms)",xlab="Stomach
Fullness",
ylab="Reactance (Ohms)", axes=FALSE,ylim=c(50,200))
axis(side=1, at=c(1,2,3,4), labels=gut)
axis(side=2)
text(1.5,115, "Mid BIA")
text(3.5,160, "Whole BIA")
points(1,135, pch=2)
points(2,135, pch=2)
points(3,135, pch=17)
points(4,135, pch=17)

Thanks ahead of time.

Keith

-- 
Keith Cox, Ph.D.
Alaska NOAA Fisheries, National Marine Fisheries Service
P.O. Box 464
Sitka, Alaska, 99835

907 752-0563
marlinkcox at gmail.com

	[[alternative HTML version deleted]]

______________________________________________
R-help at 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.


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}




More information about the R-help mailing list