-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
[R Sweave] Cyrillic characters in plots #436
Comments
Search for I guess the encoding should be |
I tried following code with various encodings without positive results. pdf("/tmp/graph.pdf", encoding="CP1251")
x <- gl(3, 4, 50, labels=c("Высшее", "Среднее", "Ср.-тех."))
pie(table(x), main="Образование")
dev.off() Seems this is not knitr bug. cairo_pdf("/tmp/graph.pdf")
x <- gl(3, 4, 50, labels=c("Высшее", "Среднее", "Ср.-тех."))
pie(table(x), main="Образование")
dev.off() works fine. Why knitr try processing the symbols when I set dev="png"? |
Because kntir records plots using the Since
|
@gasyoun Sorry I have no idea. |
@gasyoun It should work: <<include = FALSE>>=
options(device = "cairo_pdf")
@
<<echo=FALSE>>=
plot(data = cars, xlab = "Скорость", ylab = "Дистанция")
@ Note: you should define |
…'t use fig.align - use fig.caption instead: rstudio/rmarkdown#148); 2) added knitr setting to use Cairo PDF device (for potential use in the future): yihui/knitr#436; 3) added absolute path for generated figures via fig.path.
Using Cairo to render Cyrillic doesn't work in recent versions of R anymore. Go back to the PNG driver for these. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Hi.
I was faced with the fact that when create a PDF cyrillic characters not is processed. Simple example:
When I try generate PDF from RStudio I get following ouput:
For post it I launch RStudio with
LANG=C rstudio
command. My default sessionInfo():Rnw file in UTF-8 encoding. My system locale is:
Enter this commands in RStudio console give a fine results.
Thanks.
Results:
The text was updated successfully, but these errors were encountered: