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

The picture in Rstudio is displayed in Chinese - ragg need to be used #579

Open
JTCDCTWB opened this issue Oct 13, 2023 · 6 comments
Open
Labels
bug grid-plot related to grid output

Comments

@JTCDCTWB
Copy link

JTCDCTWB commented Oct 13, 2023

As a user of Officeverse,I am really grateful for your contributions!

Meanwhile, a BUG was found during application, that is after loading any package of "flextable", "officer" and "officedown", the images with Chinese characters could not be plotted into Chinese in Rstudio. If the images with Chinese characters was plotted first, then loading the above three packages, everything is OK.

R:4.3.1;
Rstudio:2023.09.0 Build 463;
Operating System:Win11(22H2) or Win10(LTSC 2019 21H2)

Looking forward to your reply at your earliest convenience.

library(tidyverse)
library(flextable)
library(officer)
tibble(性别 = c("男","女"),人数 = c(69,59)) %>%
ggplot(aes(性别,人数)) +
geom_point()

1

Restart Rstudio

library(tidyverse)
tibble(性别 = c("男","女"),人数 = c(69,59)) %>%
ggplot(aes(性别,人数)) +
geom_point()
library(flextable)
library(officer)

2

@davidgohel
Copy link
Owner

hello,

What happen if you use ragg in RStudio default plot settings? Does it solve the issue?

Capture d’écran 2023-10-13 à 07 37 38

KR

@JTCDCTWB
Copy link
Author

JTCDCTWB commented Oct 13, 2023 via email

@JTCDCTWB
Copy link
Author

JTCDCTWB commented Oct 19, 2023 via email

@davidgohel
Copy link
Owner

What happen if you use ragg in knitr settings? Does it solve the issue?

knitr::opts_chunk$set(dev="ragg_png")

@JTCDCTWB
Copy link
Author

Thank you!Problem solved.

@davidgohel
Copy link
Owner

The issue (not solved or not documented yet) will need some work. Package 'ragg' is used by flextable, but I don't understand why it conflicts with your environment. This has already been reported. I will close the issue when it will be solved. Thank you for opening the issue!

@davidgohel davidgohel changed the title The picture in Rstudio is displayed in Chinese The picture in Rstudio is displayed in Chinese - ragg need to be used Oct 20, 2023
@davidgohel davidgohel added the bug label Oct 20, 2023
@davidgohel davidgohel added the grid-plot related to grid output label Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug grid-plot related to grid output
Projects
None yet
Development

No branches or pull requests

2 participants