Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grid.echo does not always capture font face #11

Open
clauswilke opened this issue Mar 22, 2018 · 1 comment
Open

grid.echo does not always capture font face #11

clauswilke opened this issue Mar 22, 2018 · 1 comment

Comments

@clauswilke
Copy link

clauswilke commented Mar 22, 2018

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()

screen shot 2018-03-22 at 12 06 33 am

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)

screen shot 2018-03-22 at 12 06 48 am

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()

screen shot 2018-03-22 at 12 10 13 am

The font-face setting for the axis labels is lost with grid.echo():

grid.echo(pfun2)

screen shot 2018-03-22 at 12 10 18 am

@clauswilke clauswilke changed the title grid.echo does not capture font face grid.echo does not always capture font face Mar 22, 2018
@pmur002
Copy link
Owner

pmur002 commented Mar 22, 2018

Fixes for these have been pushed. Thanks again for the reports!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants