You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for another awesome package! I noticed that element_marquee() requires a width to be specified when passing images only, which means the value must be adjusted whenever the plot width changes.
library(ggplot2)
library(marquee)
logo <- system.file("help", "figures", "logo.png", package = "marquee")
md <- marquee_glue("![]({logo})")
p <- ggplot(mtcars) +
geom_point(aes(x = mpg, y = disp)) +
labs(caption = md)
## works
p + theme(plot.caption = element_marquee(width = unit(15, "cm")))
## doesn't show the image (guess because width = 0?)
p + theme(plot.caption = element_marquee())
Is there any chance to modify its behavior so that the width is automatically set according to the plot aspect ratio in case the user doesn’t specify a width?
The text was updated successfully, but these errors were encountered:
Hi @aphalo, thanks for the tip! This helps quite a lot.
However it is not spanning the full plot width by setting width = unit(1, "npc") (also makes sense as it's referring to the panel width). So in case it's possible, I think it still would be nice if the image spans the full plot width by default as the width of the axis label and the legend are influencing the width one needs to specify.
Hey Thomas,
Thanks for another awesome package! I noticed that
element_marquee()
requires a width to be specified when passing images only, which means the value must be adjusted whenever the plot width changes.Is there any chance to modify its behavior so that the width is automatically set according to the plot aspect ratio in case the user doesn’t specify a width?
The text was updated successfully, but these errors were encountered: