The R Project SVN R

Rev

Rev 60811 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 60811 Rev 70958
Line 1... Line 1...
1
#  Copyright (C) 2002-2009 The R Core Team
1
#  Copyright (C) 2002-2016 The R Core Team
2
 
2
 
3
require(datasets)
3
require(datasets)
4
require(grDevices); require(graphics)
4
require(grDevices); require(graphics)
5
 
5
 
6
## --- "math annotation" in plots :
6
## --- "math annotation" in plots :
Line 35... Line 35...
35
    c <- get.c(i, nr)
35
    c <- get.c(i, nr)
36
    if (is.null(string)) {
36
    if (is.null(string)) {
37
        string <- deparse(expr)
37
        string <- deparse(expr)
38
        string <- substr(string, 12, nchar(string) - 1)
38
        string <- substr(string, 12, nchar(string) - 1)
39
    }
39
    }
40
    text((2*(c - 1) + 1), -r, string, col="grey")
40
    text((2*(c - 1) + 1), -r, string, col="grey50")
41
    text((2*c), -r, expr, adj=c(.5,.5))
41
    text((2*c), -r, expr, adj=c(.5,.5))
42
    rect((2*(c - 1) + .5), -(r - .5), (2*c + .5), -(r + .5), border="grey")
42
    rect((2*(c - 1) + .5), -(r - .5), (2*c + .5), -(r + .5), border="grey")
43
}
43
}
44
 
44
 
45
nr <- 20
45
nr <- 20
Line 174... Line 174...
174
draw.plotmath.cell(expression(lim(f(x), x %->% 0)), i, nr); i <- i + 1
174
draw.plotmath.cell(expression(lim(f(x), x %->% 0)), i, nr); i <- i + 1
175
draw.plotmath.cell(expression(min(g(x), x >= 0)), i, nr); i <- i + 1
175
draw.plotmath.cell(expression(min(g(x), x >= 0)), i, nr); i <- i + 1
176
draw.plotmath.cell(expression(inf(S)), i, nr); i <- i + 1
176
draw.plotmath.cell(expression(inf(S)), i, nr); i <- i + 1
177
draw.plotmath.cell(expression(sup(S)), i, nr); i <- i + 1
177
draw.plotmath.cell(expression(sup(S)), i, nr); i <- i + 1
178
 
178
 
-
 
179
nr <- 11
179
make.table(nr, nc)
180
make.table(nr, nc)
180
i <- 0
181
i <- 0
181
draw.title.cell("Grouping", i, nr); i <- i + 1
182
draw.title.cell("Grouping", i, nr); i <- i + 1
-
 
183
# Those involving '{ . }' have to be done "by hand"
-
 
184
draw.plotmath.cell(expression({}(x , y)), i, nr, string="{}(x, y)"); i <- i + 1
182
draw.plotmath.cell(expression((x + y)*z), i, nr); i <- i + 1
185
draw.plotmath.cell(expression((x + y)*z), i, nr); i <- i + 1
183
draw.plotmath.cell(expression(x^y + z), i, nr); i <- i + 1
186
draw.plotmath.cell(expression(x^y + z),   i, nr); i <- i + 1
184
draw.plotmath.cell(expression(x^(y + z)), i, nr); i <- i + 1
187
draw.plotmath.cell(expression(x^(y + z)), i, nr); i <- i + 1
185
# have to do this one by hand
-
 
186
draw.plotmath.cell(expression(x^{y + z}), i, nr, string="x^{y + z}"); i <- i + 1
188
draw.plotmath.cell(expression(x^{y + z}), i, nr, string="x^{y + z}"); i <- i + 1
187
draw.plotmath.cell(expression(group("(", list(a, b), "]")), i, nr); i <- i + 1
189
draw.plotmath.cell(expression(group("(", list(a, b), "]")), i, nr); i <- i + 1
188
draw.plotmath.cell(expression(bgroup("(", atop(x, y), ")")), i, nr); i <- i + 1
190
draw.plotmath.cell(expression(bgroup("(", atop(x, y), ")")), i, nr); i <- i + 1
189
draw.plotmath.cell(expression(group(lceil, x, rceil)), i, nr); i <- i + 1
191
draw.plotmath.cell(expression(group(lceil, x, rceil)), i, nr); i <- i + 1
190
draw.plotmath.cell(expression(group(lfloor, x, rfloor)), i, nr); i <- i + 1
192
draw.plotmath.cell(expression(group(lfloor, x, rfloor)), i, nr); i <- i + 1