On 10/29/2011 09:23 AM, Hurr wrote:
Can I also label selected reciprocal numbers easily either
alongside or without the automatic ones, and have them
automatically in their correct spots.
Sorry, I really don't know R now.

Hi Hurr,
What you want is probably achievable with the "axis" function. The idea is not to display the X axis (xaxt="n") in the initial plot command and then add the custom axis later. To give a simple example:

plot(1:10,xaxt="n")
axis(side=1,at=1:10,round(labels=1/1:10,2))

or if you want fraction notation:

axis(side=1,at=1:10,labels=paste(1,1:10,sep="/"))

If you want to have both the original numbers and the fractions:

axis(side=1,at=1:10,padj=0.3,
 labels=paste(1:10,paste(1,1:10,sep="/"),sep="\n"))

and so on. The important things to remember are, "at" is where the labels will be placed and "labels" is what they will look like.

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.

Reply via email to