Re: [R] A question about using function plot

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Mon, 14 Jul 2008 13:27:08 -0300

Try:

library(lattice)
xyplot(y ~ factor(x))

or

plot(1:length(x), y, xaxt='n')
axis(1, at=1:length(x), labels=x)

On Mon, Jul 14, 2008 at 12:00 PM, Jason Liao <jg_liao_at_yahoo.com> wrote:
> Hello, everyone! I have spent two hours to get what I wanted in a simple situation and have not been successful. The set up is extremely simple
>
> x = c(1,2,4,8)
> y = c(1,2,3,4)
> plot(x, y)
>
> What I need, however, is for the 4 points of 1,2,4,8 to be spaced evenly, not by their numerical scale. Also, there should not be any other values such as 5,6,7 marked on the axis.
>
> So I tried the following
>
>
> x = c("1","2","4","8")
> y = c(1,2,3,4)
> plot(x, y)
>
> No help at all.
>
> Anyone can point me to the right way? Thank you very much.
>
> Jason
>
> ______________________________________________
> 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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
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.
Received on Mon 14 Jul 2008 - 16:31:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 Jul 2008 - 17:31:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive