OCHA-DAP / hdx-signals

HDX Signals
https://un-ocha-centre-for-humanitarian.gitbook.io/hdx-signals/
GNU General Public License v3.0
5 stars 0 forks source link

Setting plot and panel background to white #127

Closed caldwellst closed 2 months ago

caldwellst commented 2 months ago

Set plot and panel background to white. Transparent background ran into issues with dark mode. Not sure if I need to set both, but I believe plot.background is limited to plot extents, but ggsave(..., bg = NULL) is the default argument and when bg is NULL, it saves with the value specified as plot.background. So figured safer to set both.

zackarno commented 2 months ago

If I toggle off/comment out bg specification below:

https://github.com/OCHA-DAP/hdx-signals/blob/47fd332810d3a941030b1ee5884ca35523a4bc52/test/manual/maps/map_test.R#L61-L68

and I run test/manual/maps/implement_map_test.R (on a subset), the pngs have a grey transparent bg. I dont think this makes sense. Can you try?

zackarno commented 2 months ago

Actually sorry disregard the above. I restarted my R-session and the re-ran -- white background came through 😅 .

What is also weird is that the issue with the text-size being smaller on my computer also seems to have gone away? what in the world?

caldwellst commented 2 months ago

Yeah we fixed that in a different branch basically by automatically running what you said to set the {showtext} DPI to 300!