1
私は同じプロットに2つのグラフをプロットしています。それぞれに異なるイルミがあり、プロットの途中でゼロを整列させたいと思います。R - 2つのy軸がプロットの途中でゼロに整列する方法
これは私のコードです:
# data
time <- seq(0.1, 10, by = 0.1)
det_rot <- runif(100, min=-100, max=100)
vel_mag <- runif(100, min=0, max=5)
# first plot
smoothingSpline = smooth.spline(time, det_rot, spar=0.20)
plot(time, det_rot,lwd=2,
ann=FALSE, las=2, pch="", ylim=c(-100,250)) # , pch=""
lines(smoothingSpline, lwd=2, col="red")
par(new=TRUE)
# second plot
smoothingSpline2 = smooth.spline(time, vel_mag, spar=0.20)
plot(time, vel_mag,
xaxt="n",yaxt="n",xlab="",ylab="",pch="", ylim=c(0,6))
lines(smoothingSpline2, lwd=2, col="blue",)
axis(4)
プロットを参照してください:
最小限の再現可能なサンプルデータを入力してください。 'J2_arrow_only_2N'データセットを見ることができず、あなたの問題に合った偽のデータを作るのに多くの時間がかかります。 – thelatemail
ありがとう、コード – Nottolina
を編集してありがとうございます。誰かが実際に使用可能なサンプルデータの要求を実際に満たしていないことに、驚くかもしれません。ありがとう! – thelatemail