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))
)
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.
Screenshot from laptop:
Screenshot from mobile device: