理学療法士がまとめたノート

統計学備忘録(R言語のメモ)

since2016 ときどきTEXのメモ

逆関数のグラフ

Y=2x-2逆関数Y=\frac{x+2}{2}

y <- function(x){
  x
}

y1 <- function(x){
  2*x-2
}

y2 <- function(x){
  (x+2)/2
}

plot(y,xlim = c(-2,4),ylim=c(-2,4),col=2,ann=FALSE, axes=FALSE) #ann軸ラベル axes軸
par(new=T)
plot(y1,xlim = c(-2,4),ylim=c(-2,4),ann=FALSE, axes=FALSE)
par(new=T)
plot(y2,xlim = c(-2,4),ylim=c(-2,4),ann=FALSE, axes=FALSE)
axis(1, pos = 0, at = -2:4)  #軸挿入 
axis(2, pos = 0, at = -2:4)   

f:id:yoshida931:20180424121349p:plain:w500

Y=10^{x}逆関数Y=\log _{10} x

y <- function(x){
  x
}

y1 <- function(x){
  10^x
}

y2 <- function(x){
  log10(x)
}

plot(y,xlim = c(-2,4),ylim=c(-2,4),col=2,ann=FALSE, axes=FALSE) #ann軸ラベル axes軸
par(new=T)
plot(y1,xlim = c(-2,4),ylim=c(-2,4),ann=FALSE, axes=FALSE)
par(new=T)
plot(y2,xlim = c(-2,4),ylim=c(-2,4),ann=FALSE, axes=FALSE)
axis(1, pos = 0, at = -2:4)  #軸挿入 
axis(2, pos = 0, at = -2:4)   

f:id:yoshida931:20180424123304p:plain:w500