[R] How to change x axes' range

Henrik Andersson h.andersson at nioo.knaw.nl
Wed Dec 8 12:18:02 CET 2004


Try suppresing the axes with plot(...,xaxt='n')

and adding a custom axis with the command

axis(1,labels=LETTERS[1:5],at=1:5)

see ?axis for more info


Cheers, Henrik

Qin Liu wrote:
> Hi, there:
> 
> When plot ann predicted results I need to indicate numbers of inputs for
> each column. 
> 
>         V1       V2         V3          V4
> 1  86.2700  49.9380  30.7630  0.1327
> 2  89.5127  55.9707  33.7683  0.1186
> 3  91.1833  58.4670  34.5610  0.1134
> 
> matplot(t, pch = 1:4, type = "o", col = rainbow(ncol(t)),xlab = "No. of
> inputs ",  ylab = "Mean of 6 Datasets", main = "xxxxxxxxxxx")
> 
> Instead of have typical x axes' range as "1, 2, 3, and 4" for each column, I
> need to indicate "11 Vars, 10 Vars, 6Vars, and 4Vars" or "A, B, C, and D"
> 
> Does anybody know anything about it? I appreciate if you could help me out.
> 
> Thank you very much indeed.
> 
> Qin
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 


-- 
---------------------------------------------
Henrik Andersson
Netherlands Institute of Ecology -
Centre for Estuarine and Marine Ecology
P.O. Box 140
4400 AC Yerseke
Phone: +31 113 577473
h.andersson at nioo.knaw.nl
http://www.nioo.knaw.nl/ppages/handersson




More information about the R-help mailing list