Yong Wang
2007-Oct-20 07:42 UTC
[R] How to plot with txt or symbol instead of number as x-axis scale ?
Dear R-list My question is exactly as the subject, I did search the archieve but failed to find relevant message, in more details: The simplest example, 4 factors and 4 value like below: 10 20 30 40 A B C D if I plot the value, the x-axis will be scaled as 1,2,3,4 with each represent a level. How can I change the x-axis scale to A,B,C,D ? Regards young
Eric Thompson
2007-Oct-22 12:09 UTC
[R] How to plot with txt or symbol instead of number as x-axis scale ?
There are probably much more fancy ways to do this, but since no one else has posted a response, here's what I would do:> plot(seq(10, 40, 10), axes = FALSE) > axis(1, at = 1:4, lab = LETTERS[1:4]) > axis(side = 2) > box()On 10/20/07, Yong Wang <wangyong1 at gmail.com> wrote:> Dear R-list > > My question is exactly as the subject, I did search the archieve but > failed to find relevant message, in more details: > > The simplest example, 4 factors and 4 value like below: > 10 20 30 40 > A B C D > > if I plot the value, the x-axis will be scaled as 1,2,3,4 with each > represent a level. How can I change the x-axis scale to A,B,C,D ? > > Regards > young > > ______________________________________________ > 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. >
Seemingly Similar Threads
- Read in a all-character file and specify field separator and records separator
- How to do varimax rotation for principal component based factor analysis, any packages?
- Why a multi column, tab delimited file has only one column after reading in with read.table specification sep="\t"
- what does this err mean and how to solve it? Error in file(file, ifelse(append, "a", "w"))
- How to speed up the for loop by releasing memeory