wilkelab / ggtext

Improved text rendering support for ggplot2
https://wilkelab.org/ggtext/
GNU General Public License v2.0
650 stars 37 forks source link

element_textbox(...,height = unit(0.28, "npc") ) would made my .tiff strange #86

Open kangning-97 opened 2 years ago

kangning-97 commented 2 years ago

Because my textbox had sub/sup label, the heights of strip are different. Thus i set the height of textbox (height), while the outcome is strange. There is a unit(0.28, "npc") space between strip_text and the figure

                                     <My strip (a textbox with sub/sup label)>
                                                       <----a space--->
                                                          <My figure>
strip.text.x = element_textbox(
      size = 12,family = "serif",face = "bold",
      color = "white", fill = "#5D729D", box.color = "#4A618C",
      halign = 0.5,valign = 0.5, linetype = 1, r = unit(5, "pt"), width = unit(1, "npc"),height = unit(0.28, "npc"),
      padding = margin(2, 2, 2, 2), margin = margin(1, 1, 1,1)
    )

Thanks for your review. Yours sincerely!