radian icon indicating copy to clipboard operation
radian copied to clipboard

Plots display broken fonts

Open apoorvalal opened this issue 3 years ago • 4 comments

running

plot(rnorm(100), rnorm(100))

produces image

Running the same line in a regular R console produces a normal plot with correct fonts image

I'm running R 4.0.3 + radian on Ubuntu 18.04.

apoorvalal avatar Feb 14 '21 21:02 apoorvalal

It was reported multiple times. But I really have no clue.

randy3k avatar Feb 15 '21 11:02 randy3k

Maybe related to fontconfig https://stackoverflow.com/questions/62031847/ggplot-axes-are-garbled-look-like-unicode-boxes

randy3k avatar Feb 15 '21 11:02 randy3k

Thank you for pointing this out! I still have no clue how to implement the solution (partially because ${pkgs.fontconfig.out} is not valid BASH, which means that there is a different tool being used here and the only blogs that I can find that even begin to describe what this is are in a language I do not understand), but this definitely brings me closer to understanding the issue.

zkamvar avatar Jun 07 '21 14:06 zkamvar

Had the same problem on an Ubuntu machine and I think the problem is that the standard R fonts are not installed. By adding family='Sans' you can tell R to use whatever sans-serif font is available (So run plot(rnorm(100), rnorm(100), family='Sans')).

I don't really understand why this is not required when using the standard R terminal but that's my workaround for now.

I also found this thread where it was suggested to install r-cairo via conda but all that did was break the fonts on standard R which is even more confusing to me...

tlkaufmann avatar Oct 26 '21 14:10 tlkaufmann