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

ggplot2 is happy but ggMarginal is angry. I think it still works though? #16

Open
taylorreiter opened this issue Jun 14, 2024 · 2 comments

Comments

@taylorreiter
Copy link
Member

this works fine:

library(tidyverse)
library(arcadiathemeR)

plt1 <- ggplot(blastp_distinct, aes(x = pident, y = qcovhsp, color = peptigate_prediction_tool)) +
  geom_point() +
  theme_arcadia() +
  theme(legend.position = "bottom") +
  scale_color_arcadia()
plt1

but this:

library(ggExtra)
ggMarginal(plt1, type = "histogram", groupColour = T, groupFill = T)

produces:

Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntl-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
Warning message in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
“font family 'SuisseIntlMono-Regular' not found in PostScript font database”
@elizabethmcd
Copy link
Contributor

Interesting that the fonts fail here for ggExtra and not regular ggplot2. Can you try this again with the new commits to the sysfonts branch? I changed how fonts are searched for and loaded in, but not really sure this will fix this specific issue.

@taylorreiter
Copy link
Member Author

I think the changes fix this, with the caveat that last time I was in jupyter notebook and now I'm in RStudio. To make this more reproducible, here's the code i used:

library(arcadiathemeR)
library(tidyverse)
library(ggExtra)

plt <- ggplot(mpg, aes(x = cty, y = hwy, color = drv)) +
  geom_point() +
  theme_arcadia() +
  theme(legend.position = "bottom")

ggMarginal(plt, groupColour = T, groupFill = T)

and here's the result:
image

So the font issue is fixed. The background doesn't extend properly to ggMarginal. I fixed it by doing this:

plt2 <- ggMarginal(plt, groupColour = T, groupFill = T)

plt2$layout$t[1] <- 1
plt2$layout$r[1] <- max(plt2$layout$r)

plt2

image

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