-
Notifications
You must be signed in to change notification settings - Fork 25
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
sf + ggplot + ragg doesn't print degree symbol #51
Comments
I cannot reproduce this. What system are you on? And does the issue persist with the development version? |
Using Windows 10 -- just re-installed the development version of
|
Thanks - I'll try to check this out on windows. |
I can reproduce on Windows |
OK, so apparently the symbol font does not provide a Unicode character map but only understands the ancient Adobe Symbol encoding... this is fixable but I'll have to think about the path of least resistance (esp since it is a windows only problem) |
I have had this same issue recently, though I can't pinpoint when it started happening. When I use Here is a reprex that will reproduce this same issue on my Windows 10 machine:
I suspect that this is related to my windows fonts somehow, but any additional insight would be appreciated. I will struggle mightily before developing a hacky workaround. Thank you! Here is my
|
@MargaretSiple-NOAA - Ditto here - having the exact same problem with the Degree symbols not rendering. |
@grwhumphries Does it resolve if you use R 4.2.1 or 4.2.0 instead of 4.2.2? I am not sure if the version is the issue but that's how I was able to resolve the issue temporarily. Not ideal, but it did work! |
Just updated to 4.2.2 and have this issue as well. Resolves itself in 4.2.1. here is my
|
Also having this issue on a Windows system since updating to R 4.2.2 (resolved once I switched to R 4.2.1). Here is my Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_Canada.utf8 LC_CTYPE=English_Canada.utf8
[3] LC_MONETARY=English_Canada.utf8 LC_NUMERIC=C
[5] LC_TIME=English_Canada.utf8
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] ggplot2_3.4.0 sf_1.0-9 dplyr_1.0.10 targets_0.14.0 patchwork_1.1.2
loaded via a namespace (and not attached):
[1] Rcpp_1.0.9 pillar_1.8.1 compiler_4.2.2 class_7.3-20
[5] tools_4.2.2 qs_0.25.4 digest_0.6.30 lifecycle_1.0.3
[9] tibble_3.1.8 gtable_0.3.1 pkgconfig_2.0.3 rlang_1.0.6
[13] igraph_1.3.5 DBI_1.1.3 cli_3.4.1 ggrepel_0.9.2
[17] yaml_2.3.6 xfun_0.35 e1071_1.7-12 withr_2.5.0
[21] knitr_1.41 generics_0.1.3 vctrs_0.5.1 classInt_0.4-8
[25] grid_4.2.2 tidyselect_1.2.0 RApiSerialize_0.1.2 glue_1.6.2
[29] data.table_1.14.6 R6_2.5.1 processx_3.8.0 fansi_1.0.3
[33] base64url_1.4 farver_2.1.1 callr_3.7.3 magrittr_2.0.3
[37] units_0.8-0 backports_1.4.1 scales_1.2.1 ps_1.7.2
[41] codetools_0.2-18 colorspace_2.0-3 renv_0.16.0 KernSmooth_2.23-20
[45] stringfish_0.15.7 utf8_1.2.2 proxy_0.4-27 RcppParallel_5.1.5
[49] munsell_0.5.0 ``` |
I switched back to 4.2.1 and the issue was resolved. Unsure what's going on there. Hopefully gets picked up |
Thanks for the reports everyone... I'll see if I can figure out what is going on - weird how the R version can affect this |
Hi folks! I just updated to R 4.2.2 and am also having this problem. Session Info:
|
Hi all! I had the same issue in R 4.2.2, and it got resolved when I switched back to R 4.2.1. |
I'm looking into it... will hopefully have a fix soon |
Hmm... I have now tried to reproduce this on a Widows machine. I am completely unable to reproduce this issue in ragg. However, I do get the reported behaviour with the default windows device so I suspect that this is the device you are all using. To make sure, can I get any of the above posters to run this piece of code and report if they indeed experience the issue: library(grid)
ragg::agg_png("unicode_test.png")
grid.newpage()
grid.text(expression(90*degree))
dev.off() |
Hi @thomasp85 -- I ran the code above (now using R 4.2.2) and the piece of code returned this. It seems like the issue doesn't occur with the code you gave, but I didn't know I had changed the device I was using! Not sure what else it could be. When I run the code I pasted in my example above, I still get the sad squares-instead-of-degrees issue. I'm on a Windows machine too. I hope this gets us one step closer to solving the mystery... |
Thanks for responding so quickly @MargaretSiple-NOAA — can you be more specific about how you generate the plot where you see the issue? Do you open a device with The output of my provided code heavily suggests you are not using ragg in any way |
Thanks for looking into this @thomasp85. I can see the degree symbol when I run your code. I don't think I am using Based on your comment above, I realized that the issue depends on how I am viewing the plot. Here is a quick reprex:
When I run the above code, this is what I see in the RStudio plot pane and in word and html documents generated from RMarkdown: When I save the map as a png or jpg with This is my session info:
|
I'm pretty sure my ideas are right - all of your issues are related to the default windows device and not anything in ragg/ggplot2/sf In general, the default windows graphics device is horrible and you should all avoid using it :-) Going to close this. Please open another issue if an example that clearly shows an issue in ragg is observed |
Good to know! |
in the RMarkdown file you have to specify a different graphics device than the default, using the |
I will check that out - thanks again! Edit - adding |
@thomasp85 Thanks for that; I didn't realize that the default windows device was bad! I am grateful for this education. I changed my graphics device backend to AGG and also set it in my knitr options and all is well. |
anyone have a workaround in an interactive context? (meaning no ggsave, nor r markdown) |
This is not an issue with ragg but a problem with the default png device shipped with R on windows. If you use RStudio you can set change the device used in the plot pane as per the instructions in the ragg read me |
The text was updated successfully, but these errors were encountered: