Ich möchte grundsätzlich einen Bereich hinter einer Grafik schattieren.Wie benutzt man `polygon()` in der logarithmischen Skala?
Es ist einfach genug, in der linearen Skala zu tun.
x <- 1:20
y <- x^2
plot(x, y, type="l")
polygon(c(10,10,15,15),
c(-100,600,600,-100),
col=rgb(0,1,0,0.3),border=FALSE)
Produziert dies:
Aber sobald Sie setzen y auf einer logarithmischen Skala,
plot(x, y, type="l", log="y")
polygon(c(10,10,15,15),
c(-100,600,600,-100),
col=rgb(0,1,0,0.3),border=FALSE)
Nichts auftaucht.
warum Sie nicht verwenden plot (x, log (y), type = „l ')? –