You can do something like this for a scatter plot:
x <- c("a","b","c")
y <- c(1,2,3)
xnum <- rep(1:length(x))
plot(x=xnum, y=y, xlab="x", xaxt="n")
axis(side=1, at=xnum, labels=x)
This fakes a numerical axis and suppresses the y-axis labels that you then
draw with the axis function the way that you want them. If you play with the
xnum vector, you can have different spacing of the points in the
x-direction.
Rene
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of XinMeng
Sent: Monday, December 18, 2006 1:03 AM
To: [email protected]
Subject: [R] plot
Hello sir:
a data with 2 columns:
id x
a 1
b 2
c 3
I wanna get such kind of plot:
x: a b c
y:1 2 3
But the plot command doesn't permit string character as x.
How can I get it ?
Thanks a lot !
My best
______________________________________________
[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.
______________________________________________
[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.