rstudio / gt

Easily generate information-rich, publication-quality tables from R
https://gt.rstudio.com
Other
1.94k stars 197 forks source link

ggplot in gt rows: handle "empty" space within cells #1606

Open ScaonE opened 3 months ago

ScaonE commented 3 months ago

Dear all,

I have trouble trying to control ggplots aspect within a gt table. I started from this recipe : https://rfortherestofus.com/2023/10/ggplots-in-gt-tables

Below the relevant lines of my code:

=> What I'd like to handle are the "empty zones" (aka reduce them to the minimum size) around the horizontal stacked barplots (which I tried to highlight in red on the screenshot). Can this be handled on the gt side? Any tips ?

Best regards

rich-iannone commented 1 month ago

If the padding is 0 then I imagine the plots have some top/bottom whitespace. Could you look at your table in a browser's developer tools and see whether this is the case?