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

LAB.FONT issues #502

Closed
Cami1992 opened this issue Oct 16, 2022 · 1 comment
Closed

LAB.FONT issues #502

Cami1992 opened this issue Oct 16, 2022 · 1 comment

Comments

@Cami1992
Copy link

country <- c( "salvador", "honduras", "guatemala")

data_2022ago <- data.frame(
number = c(10399, 66763,68663),
country = factor(country, levels = country),
y = seq(length(country)) * 0.9
)%>%
dplyr::mutate(total = sum(number))%>%
mutate(prop = number/total)%>%
dplyr::mutate(percent = paste0(round(prop*100), "%"))%>%
mutate(label = paste(percent, "\n","(", scales::comma (number), ")", sep = ""))
CHART

ggpubr::ggdonutchart(data = data_2022ago, x = "number", color = "white",
fill = "country",lab.pos = "out",
orientation = "horizontal",
lab.font = c(12, "bold", "blue"))
PROBLEM: It does not give me the right font in terms of colour and size

kassambara added a commit that referenced this issue Nov 22, 2022
@kassambara
Copy link
Owner

Now, ggpie() and ggdonutchart() now fully reacts to the option lab.font

suppressPackageStartupMessages(library(ggpubr))
suppressPackageStartupMessages(library(dplyr))

country <- c( "salvador", "honduras", "guatemala")

data_2022ago <- data.frame(
  number = c(10399, 66763,68663),
  country = factor(country, levels = country),
  y = seq(length(country)) * 0.9
)%>%
  dplyr::mutate(total = sum(number))%>%
  mutate(prop = number/total)%>%
  dplyr::mutate(percent = paste0(round(prop*100), "%"))%>%
  mutate(label = paste(percent, "\n","(", scales::comma (number), ")", sep = ""))

ggpubr::ggdonutchart(data = data_2022ago, x = "number", color = "white",
                     fill = "country",lab.pos = "out",
                     orientation = "horizontal",
                     lab.font = c(4, "bold", "blue"))
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.

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