On 08/05/2010 07:14 AM, yan liu wrote:
Hello,
I had a question about how to label a axis of a plot.
for example, my plot is
plot(1:100, axes=F)
box()
axis(1)
then, I want my y-axis has six ticks ( at=seq(0,100,10)) , but I don't want
to label all the 11 ticks, I only want to label the 1st, 3rd, 5th, 7th and
11th ticks. But the code axis(), always need the length of the "labels" and
"at" be equal, and not allow label partially.
Hi Yan,
I think you mean that you want to label 6 of the 11 ticks. Try this:
axis(1,at=seq(0,100,10),
labels=c("1","","3","","5","","7","","9","","11"))
Sneakiness is its own reward.
Jim
______________________________________________
[email protected] 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.