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

jupyter notebook #19

Open
slowkow opened this issue May 4, 2018 · 2 comments
Open

jupyter notebook #19

slowkow opened this issue May 4, 2018 · 2 comments

Comments

@slowkow
Copy link

slowkow commented May 4, 2018

Hi Yixuan,

I wonder if you might have an idea why showtext is not working as expected in the Jupyter notebook. Is there any way I can try to debug this?

Here's a notebook showing that showtext is actually working, but not when it is displayed automatically by Jupyter...

In other words, I have to save the figure to a file and then show the file with:

library(imager)
im <- load.image("showtext-ex2.png")
plot(im, axes = FALSE)

https://gist.github.com/slowkow/771238703396bd006f3aeb0943147c85

Is it possible to modify showtext to display by default in a Jupyter notebook?

Do you know any workarounds?

R version 3.4.0 (2017-04-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux Server release 6.5 (Santiago)

Matrix products: default
BLAS: /apps/lib-osver/R/3.4.0/lib64/R/lib/libRblas.so
LAPACK: /apps/lib-osver/R/3.4.0/lib64/R/lib/libRlapack.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] showtext_0.5-1 showtextdb_2.0 sysfonts_0.7.2

loaded via a namespace (and not attached):
[1] getPass_0.2-2 digest_0.6.15 crayon_1.3.4
[4] IRdisplay_0.4.4 repr_0.12.0 jsonlite_1.5
[7] magrittr_1.5 evaluate_0.10.1 stringi_1.1.6
[10] curl_3.0 uuid_0.1-2 IRkernel_0.8.10.9000
[13] Cairo_1.5-9 tools_3.4.0 stringr_1.3.0
[16] compiler_3.4.0 pbdZMQ_0.3-2

@slowkow slowkow changed the title fonts are not working jupyter notebook May 6, 2018
@yixuan
Copy link
Owner

yixuan commented May 7, 2018

I am not 100% sure, but have you tried to use the showtext_auto() function to automatically enable showtext?

@slowkow
Copy link
Author

slowkow commented May 7, 2018

I have, and it doesn't work. Thanks for the suggestion!

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