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

font selection for ggscatter #149

Closed
419kfj opened this issue Jan 17, 2019 · 3 comments
Closed

font selection for ggscatter #149

419kfj opened this issue Jan 17, 2019 · 3 comments

Comments

@419kfj
Copy link

419kfj commented Jan 17, 2019

I tried to change the font family as followings using "font.family= "....".
But nothing has changed.

How can I do it.

I suppose it related to factextra font issue# 77 (#31, #50 )

ggpubr is version 0.2

regads.
kazuo

data("mtcars")
df <- mtcars
df$name <- rownames(df)
df$cyl <- factor(df$cyl)
ggscatter(df, x = "wt", y = "mpg",
color = "cyl", palette = c("#00AFBB", "#E7B800", "#FC4E07"),
label = "name", repel = TRUE,font.family = "TimesNewRomanPSMT")
@monicathieu
Copy link

monicathieu commented Mar 12, 2019

Hi there,

Wanted to second this bug! Also on ggpubr v0.2 .

Example:

# To simulate an overplotty labeled dataset
df <- data.frame(state = state.name, x = rnorm(50), y = rnorm(50))

# Changes text
ggplot(df, aes(x = x, y = y, label = state)) +
  geom_text(family = "Comic Sans MS")

# Changes text
ggplot(df, aes(x = x, y = y, label = state)) +
  ggrepel::geom_text_repel(family = "Comic Sans MS")

# Doesn't change text
ggpubr::ggscatter(df, x = "x", y = "y", label = "state", repel = TRUE, font.family = "Comic Sans MS")

The ggscatter axis font changes, so font.family is recognized by the final theme call inside ggscatter, but I suspect that ggpubr::geom_exec() is not passing it through to the underlying geom call for some reason.

@419kfj
Copy link
Author

419kfj commented Dec 14, 2019

I find that to display on the plot area of the scatter plot is complicated by reading the following document.

“showtext: Using Fonts More Easily in R Graphs” https://cran.rstudio.com/web/packages/showtext/vignettes/introduction.html

And I tried to use this package, "showtext" with ggpubr and factoextra, and FactoMineR v2.0.

As I posted to factoextra issue, this is the solution to this issue.

http://rpubs.com/kfj419/559740

kassambara added a commit that referenced this issue Jun 6, 2020
@kassambara
Copy link
Owner

fixed now, thanks. The option font.family is now correctly handled in ggscatter()

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

3 participants