[R] Troubles with labeling x axis

iDa ajda.korosec at abelium.eu
Wed Mar 6 15:07:20 CET 2013


Hi!

I have problems with labeling x axis while plotting time series data. I have
40 monthly measurement. One period lasts 4 months. I'd like to have 40 ticks
on x axis (10 larger, the rest smaller) and labels just at the beginning of
each period, just like in the image
<http://r.789695.n4.nabble.com/file/n4660465/2221.jpg> 

My code leaves x axis empty:

> data <- read.csv(file="CSV files/Komen.csv", head=TRUE, sep=";")
> dataTimeSeries <- ts(data, frequency=12, start=c(2000,4))
> dataTimeSeries
     Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2000               7  45  47   3  24 132  35  32  28
2001 161  48  31  33 161 154 420  19 149  44  54  16
2002 152  94  43  64 193  85  98  77 236  87  72  47
2003 196 120  51  27 143  99  56                    
> require(graphics)
> plot.ts(dataTimeSeries, xaxt="n", xlab= "Perioda", ylab= "Opazovane
> vrednosti", type='l', col='red')
> axis(side=1, at=seq(1,40,4), labels=seq(1,10,1))

Thanks in advance for any help!



--
View this message in context: http://r.789695.n4.nabble.com/Troubles-with-labeling-x-axis-tp4660465.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list