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

letters are overlapping when using ggtext & ggiraph on mobile device #62

Open
werkstattcodes opened this issue Mar 18, 2021 · 1 comment

Comments

@werkstattcodes
Copy link

I am trying to produce a plot using ggplot, ggtext, and ggiraph. The plot title should contain some words in color.
The code below works fine as long as I look at the produced graph on a larger screen (laptop is ok). When I look at it on a mobile device, the letters are overlapping.

I tried to isolate the problem and put it online here:

I had also put on a related SO question, but to no avail. Many thanks.

library(ggtext)
library(ggiraph)
library(tidyverse)

my_plot <- mtcars %>% 
  ggplot()+
  labs(title=glue::glue("this is a very long title, with many lines and a line <br>break etc etc etc, this <br>word is in <span style='color:red;'>red</span> or something else etc etc"))+
  geom_point_interactive(aes(x=wt,
                             y=qsec,
                             tooltip=paste(wt, qsec)))+
   theme(plot.title=element_markdown())

girafe(ggobj = my_plot,
       fonts=list(sans="Roboto Condensed"),
       height_svg = 5,
       options = list(
         opts_toolbar(saveaspng = FALSE))
)

Screenshot from laptop:
laptop_screenshot

Screenshot from mobile device:
mobile_screenshot

@bwiernik
Copy link
Collaborator

Install the latest version of gridtext from https://github.com/wilkelab/gridtext. It should be on CRAN soon.

@bwiernik bwiernik reopened this Sep 15, 2022
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