gridgraphics
gridgraphics copied to clipboard
grid.echo does not always capture font face
When reviewing this commit prompted by issue #10, I started wondering whether the font face is properly captured. The answer seems to be "not always". I'm opening a separate issue for this because it's independent of the device issue.
pfun <- function() {
plot(1:10, 1:10, font = 2, font.lab = 3, font.main = 4,
xlab = "x axis", ylab = "y axis", main = "Plot title")
}
pfun()
Here, grid.echo() misses the generic font specification, which applies to the axis tick labels. Plot title and axis labels are correctly styled, however.
grid.echo(pfun)
Now for 3d plots:
library(plot3D)
pfun2 <- function() {
par(mar = c(0, 0, 0, 0), mai = c(0, 0.1, 0, 0))
scatter3D(mtcars$disp, mtcars$hp, mtcars$mpg, colvar = mtcars$cyl,
pch = 19, bty ="b2", theta = 20, phi = 30, colkey = FALSE,
xlab = "displacement (cu. in.)", ylab ="power (hp)", zlab = "efficiency (mpg)",
font.lab = 4)
}
pfun2()
The font-face setting for the axis labels is lost with grid.echo():
grid.echo(pfun2)
Fixes for these have been pushed. Thanks again for the reports!