Voici un exemple de mes données:
Code : Tout sélectionner
composite
.depth year Al Si P S Cl K Ca
0.1 2011 0.000000000 0.000000000 0.001260379 0.002588886 0.000000000 0.01076432 0.01454545
0.2 2011 0.000000000 0.000436172 0.001490256 0.002471643 0.000327129 0.01064988 0.01501160
0.3 2011 0.000000000 0.000246960 0.000905521 0.003416285 0.000370441 0.01382978 0.01572314
0.4 2011 0.000321730 0.002849606 0.001103073 0.002252108 0.000000000 0.02633588 0.02132609
0.5 2011 0.000786997 0.004259042 0.001527700 0.003518339 0.000462939 0.04184971 0.02615607
0.6 2011 0.001126383 0.005091252 0.001306604 0.001621992 0.000000000 0.05158835 0.02766397
0.7 2011 0.001598099 0.006638259 0.000491723 0.001352238 0.000000000 0.06007214 0.02950337
0.8 2011 0.001223572 0.006693659 0.000863698 0.001547459 0.000000000 0.07589745 0.03382817
0.9 2011 0.000581450 0.007798265 0.001265508 0.001128696 0.000684058 0.08191599 0.03481857
1.0 2011 0.001509006 0.008824402 0.000852916 0.001115352 0.000000000 0.07932120 0.03526480
1.1 2011 0.000603871 0.008454197 0.000572088 0.000540306 0.000000000 0.08228539 0.03912450
1.2 2011 0.000000000 0.008822382 0.000632429 0.000822157 0.000221350 0.08793922 0.03902086
1.3 2011 0.001552920 0.008461829 0.001362766 0.001521228 0.000348615 0.08686844 0.04211899
1.4 2011 0.000477181 0.010847924 0.000954363 0.001495168 0.000000000 0.09457736 0.04138753
1.5 2011 0.001148499 0.011772119 0.000000000 0.000957083 0.000000000 0.09436836 0.04361107
1.6 2011 0.001560828 0.011403604 0.000700780 0.000509658 0.000000000 0.09498756 0.04179198
1.7 2011 0.002276676 0.012015792 0.001644266 0.001833989 0.000126482 0.09565203 0.04382602
1.8 2011 0.001663461 0.012209176 0.001757619 0.000784651 0.000345247 0.10122003 0.04485068
1.9 2010 0.001398783 0.014236505 0.001305531 0.000341925 0.000279757 0.10055698 0.04441914
2.0 2010 0.002613637 0.013529415 0.001291444 0.000707219 0.000000000 0.10577543 0.04393985
2.1 2009 0.000520058 0.013674457 0.000703607 0.001193073 0.000397691 0.10486810 0.04894660
2.2 2009 0.002365972 0.013194846 0.001880645 0.001122320 0.000970655 0.09994717 0.04783511
2.3 2008 0.001413935 0.013327093 0.000631758 0.001263517 0.000722010 0.09744120 0.04527601
2.4 2007 0.001773155 0.014816366 0.000601070 0.000270481 0.000270481 0.09740333 0.04375787
2.5 2007 0.000954130 0.012850939 0.001222479 0.001043580 0.000327982 0.09135795 0.04400925
2.6 2006 0.000943874 0.011709934 0.000737401 0.001002866 0.000707905 0.09185071 0.04471602
2.7 2006 0.001778258 0.011427495 0.001457589 0.001428437 0.000320670 0.08847563 0.04358190
2.8 2006 0.000486832 0.011368954 0.000429557 0.001202761 0.000000000 0.08407871 0.04218254
2.9 2006 0.000788350 0.011431082 0.000000000 0.000478641 0.000000000 0.08390301 0.04088160
3.0 2005 0.000836473 0.011320262 0.000724943 0.000474001 0.000948002 0.08141666 0.04173998
j’ai essayer d’adapter le script suivant:
Code : Tout sélectionner
x <- c(1:10); y <- x; z <- 10/x
# create extra margin room on the right for an axis
par(mar=c(5, 4, 4, 8) + 0.1)
# plot x vs. y
plot(x, y,type="b", pch=21, col="red",
yaxt="n", lty=3, xlab="", ylab="")
# add x vs. z
lines(x, z, type="b", pch=22, col="blue", lty=2)
# draw an axis on the left
axis(2, at=x,labels=x, col.axis="red", las=2)
# draw an axis on the right
axis(4, at=z,labels=round(z,digits=2),
col.axis="blue", las=2, cex.axis=0.7, tck=-.01)
C’est le genre de graphique que je voudrais , j'aimerais surtout qu'il affiche exactement toutes les année sur l’axe de droite, même si elle se répètent.
Mais je n’arrive pas, voici mon script adapté de l’original au dessus.:
Code : Tout sélectionner
# specify the data
x <- xrf3[,"Ca"]; y <- xrf3[,"composite.depth"]; z <- xrf3[,"year"]
# create extra margin room on the right for an axis
par(mar=c(5, 4, 4, 8) + 0.1)
# plot x vs. y
plot(x, y,type="b", pch=21, col="red",
yaxt="n", lty=3, xlab="", ylab="")
# add x vs.z
lines(x, z, type="b", pch=22, col="blue", lty=2)
# draw an axis on the left
axis(2, at=y,labels=y, col.axis="red", las=2)
# draw an axis on the right
axis(4, at=z,labels=round(z),
col.axis="blue", las=2, cex.axis=0.7, tck=-.01)
merci de m’aider, je suis complétement bloqué, si vous avez un autre moyen je suis aussi preneur.
Arnaud