Open swhalemwo opened 1 year ago
thanks for this great package! While working with it, I noticed that lineheights are not properly scaled when they are smaller than 1.
library(ggplot2) library(ggtext) library(gridExtra) df2 <- data.frame(x=c(1,2), y=c(2,1), label1 = c("linebreaks\nlinebreaks\nlinebreaks", "linebreaks\nlinebreaks\nlinebreaks"), label2 = c("linebreaks<br>linebreaks<br>linebreaks", "linebreaks<br>linebreaks<br>linebreaks")) ## small linebreaks work in geom_label p1 <- ggplot(df2, aes(x=x, y=y)) + geom_label(aes(label = label1), lineheight = 0.3) + xlim(0, 3) + ylim(0,3) ## small linebreaks don't work properly in geom_richtext p2 <- ggplot(df2, aes(x=x, y=y)) + geom_richtext(aes(label = label2), lineheight = 0.3) + xlim(0, 3) + ylim(0,3) ## larger linebreaks work properly p3 <- ggplot(df2, aes(x=x, y=y)) + geom_richtext(aes(label = label2), lineheight = 3) + xlim(0, 3) + ylim(0,3) grid.arrange(p1,p2,p3)
Created on 2022-09-28 with reprex v2.0.2
thanks for this great package! While working with it, I noticed that lineheights are not properly scaled when they are smaller than 1.
Created on 2022-09-28 with reprex v2.0.2