Odd numbers in simple graphics

7 views
Skip to first unread message

Eduardo_D

unread,
Aug 15, 2008, 6:08:45 PM8/15/08
to CorpLing with R
This could be a newbie question, but I can´t find information about it
on R manuals. This is my inquiry: How can I make a plot to show odd
numbers in an axis? This is for simple graphics, for example when
plotting two objects, a <- 1:10 ; b <- 11:20, I don´t get odd
numbers. Thank you very much.

Stefan Th. Gries

unread,
Aug 15, 2008, 6:14:02 PM8/15/08
to corplin...@googlegroups.com
You just don't let R decide on the axes, but define them yourself. In
your case, for example, where both vectors to be plotted have an odd
number as their first element:

a<-1:10; b<-11:20
plot(b~a, axes=F); box()
axis(1, at=seq(min(a), max(a), 2))
axis(2, at=seq(min(b), max(b), 2))

These pages should help:

?axis
?seq

HTH,
STG
--
Stefan Th. Gries
-----------------------------------------------
University of California, Santa Barbara
http://www.linguistics.ucsb.edu/faculty/stgries
-----------------------------------------------

Eduardo_D

unread,
Aug 19, 2008, 5:26:34 PM8/19/08
to CorpLing with R
Thank you very much, Prof. Gries
Reply all
Reply to author
Forward
0 new messages