jthomasmock / gtExtras

A Collection of Helper Functions for the gt Package.
https://jthomasmock.github.io/gtExtras/
Other
195 stars 27 forks source link

gt_plt_bar_stack font #119

Closed ScaonE closed 7 months ago

ScaonE commented 7 months ago

Dear all,

Is there a way to change the font for numbers within the stacked barplot? (I wish to use Nunito to have the same font everywhere in my doc).

(asking because I cannot control it via : opt_table_font(font = google_font(name = "Nunito Sans")))

jthomasmock commented 7 months ago

Howdy @ScaonE -- the numbers are hardcoded as family='mono' as seen in:

https://github.com/jthomasmock/gtExtras/blob/e810e592571571fde2745194f007574d8c51bfdc/R/gt_pct_bar.R#L120-L124

I'm adding a new font argument, and here's it with Nunito

image

vs the default mono:

image