Description Usage Arguments Details Value Examples
Possibly filled rectangles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
xleft |
spedifier for the bottom left corner |
ybottom |
spedifier for the top right corner |
... |
additional arguments, as for |
border |
colour, as for |
colour, color |
alternative names for |
col |
colour, as for |
fill |
alternative name for |
The primary function in the graphics
package
requiers the corners of the rectangle to be specified by
four separate real numbers. This interface allows the
corners, in addition, to be specified by two "xy"
specifiers for the opposite corners, or single "xy"
object to specify both. See the example for a typical case.
as for rect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | bluish <- alpha("sky blue", 0.5)
curve(dnorm, xlim = c(-4,4), n = 1000, ## establish the plotting coordinate system
xlab = expression(italic(z)),
ylab = expression(phi(italic(z))))
corners <- complex(real = par("usr")[1:2], imaginary = par("usr")[3:4])
rect(corners, fill = bluish, colour = bluish)
curve(dnorm, xlim = c(-4, 4), n = 1000, add = TRUE, col = "red")
abline(h = 0, v = 0, lty = "dashed")
z <- c(1.96, seq(1.96, 4, length.out = 500))
z <- complex(real = z, imaginary = c(0, dnorm(z)))
polygon(z, density = 15, angle = -45, colour = "red")
arrows(3, 0.05, 2.5, dnorm(2.5)*0.4, length = 2, gap = 2)
text(3, 0.05, expression(area == alpha/2), pos = 3, cex = 0.8, offset = 0)
Re(z) <- -Re(z)
polygon(z, density = 15, angle = 45, colour = "red")
arrows(3, 0.05, 2.5, dnorm(2.5)*0.4, length = 2, gap = 2)
text(-3, 0.05, expression(area == alpha/2), pos = 3, cex = 0.8, offset = 0)
arrows(-3, 0.05, -2.5, dnorm(-2.5)*0.4, length = 2, gap = 2)
text(-1.25, 0.05, expression(zeta[ alpha/2] == -zeta[1-alpha/2]), pos = 3, offset = 0)
arrows(-1.25, 0.05, -1.96, 0, length = 2, gap = 2)
text( 1.25, 0.05, expression(zeta[1-alpha/2]), pos = 3, offset = 0)
arrows( 1.25, 0.05, 1.96, 0, length = 2, gap = 2)
text("top left",
expression(phi(italic(z)) == frac(exp(-italic(z)^2/2), sqrt(2*pi))), cex = 0.8)
text("top right",
expression(Phi(z) == integral(phi(italic(t))*italic(dt), -infinity, z)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.