-
Notifications
You must be signed in to change notification settings - Fork 35
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
loading {dlookr} in RMarkdown changes ggplot font size? #79
Comments
When loading the dlookr package, the fonts are also loaded, which seems to have caused a side effect. Thanks for your report. |
Thank you! This is just a wild guess, as I have not looked at your code, but if you are loading {showtext}, then this issue may be related to yixuan/showtext#51 |
@SchmidtPaul As your information, it seems to be an issue with the showtext package. sorry my miss typo I will find a way to solve the problem inside dlookr. |
@choonghyunryu ---
title: "reprex"
output: html_document
---
```{r, message=FALSE}
library(dlookr) # with or without
showtext::showtext_opts(dpi = 300)
library(ggplot2)
ggplot(mtcars) +
aes(y = mpg, x = cyl) +
geom_point()
``` |
sorry for my miss typo in the previous. I will find a way to solve the problem inside dlookr. But you kindly provided an answer. I use a mac, and the problem has not occurred on mac. I used your solution as follows. The problem that the font was printed very small has been resolved. In the visualization function provided by the dlookr package, the font becomes very large.
dpi=150 seems reasonable, like this:
By the way, this example feels a bit small.
I will solve the problem by running the following script when loading dlookr in the next version. showtext::showtext_opts (dpi = 150) What do you think of using dpi=150? |
Thank you for investigating! I usually go with
In the same comment, however, is a link that I had not taken seriously before, but which deals with my problem right now:
So now I think I understand what to do if I want to have ggplots in my RMarkdown after loading {showtext}. The problem, however, is that I did not actually (want to) load {showtext}, I just loaded {dlookr}. So I currently do not know how this can be solved. Naturally, I should not have to set Just to give you the full picture: Here is the actual document where I came across this issue. I briefly use
And this is a good enough solution for now, but obviously not optimal. |
Thank you for your kind explanation. The dlookr package uses several fonts to add more aesthetics to the plots provided by the dlookr package. When the dlookr package is loaded, it loads some fonts together and activates the showtext package. This is invisible, but happens when the dlookr package is loaded. The following code is executed when the dlookr package is loaded.:
I am considering modifying this logic for the following reasons:
However, this task needs to be modified with all the visualization functions provided by dlookr. I would like to thank your dlookr for a lot of interest in this Issue. I'll try to make the dlookr package more useful and work without side effects. |
Hi @choonghyunryu, I know that your Note, however, that when teaching workshops, I currently still promote your instead of my version. Cheers, |
I will consider the ability to allow the user to adjust the font size in the dlookr package visualization functions. Cheers, |
Hi, I stumbled upon an unexpected outcome while using {dlookr} in RMarkdown. Basically, this code:
will create ggplots with different font sizes depending on whether
library(dlookr)
is included or not. Is it possible that loading {dlookr} changes the parameters forfig.width
or similar?!The text was updated successfully, but these errors were encountered: