[R] different values under the x axis labels

Luboš Behenský LubosBehensky at seznam.cz
Sat Nov 7 00:39:45 CET 2009


Hi everyone,
I am a complete beginner, no mathematician and I would like to ask You for help since this is my first experience with such a software like "R".

I have a .xls source file from 1 to 3600 seconds, each second has a noise level value. (attached in case you are interested)
Imported as "Dataset".
I would like to make a graph: Here is what I have been able to use:

par(mar = c(5, 4, 4, 2) + 0.1)
plot(Dataset, type="l", xlab="čas [s]", ylab= expression(paste("Hladina akustického tlaku","     ", bold(L[pA])," [dB]")), col="blue", xlim=c(0,3600), ylim=c(35,60), xaxs = "i", yaxs = "i",cex.main=1.5, cex.lab=1.2,xaxt="n")
abline(h=43,col="red",lwd=2)
title(main = "Místo příjmu 3, čas 9:00 - 10:00",font.main="2", line=3)
axis(3, xaxp=c(0, 3600, 12), mgp=c(3,0.6,0))
axis(1, xaxp=c(0, 3600, 12), mgp=c(3,0.6,0))
smartlegend(x="left", y="top",c(expression(paste(bold(L[eqA.1h]),bold(" [dB]"))), expression(paste(bold(L[pA]),bold(" [dB]")))),col=c("red","blue"), lty= 1:1,lwd=2, y.intersp= 1.1, bg="grey96",cex=1.1)

I succeeded in changing scale on both "X" after 300 seconds and now I would like to swap the value 300, 600, 900 (seconds)of the top axis to 5, 10, 15 (minutes) and so on OR
the best of all would be to have these numbers (minutes) under the original bottom x axis values in different color.


Thank you very much for any ideas.

Lubo 

 


More information about the R-help mailing list