gjoseph92 / geogif

Turn xarray timestacks into GIFs
https://geogif.readthedocs.io/
MIT License
86 stars 5 forks source link

Adjusting date time text to match image size #22

Closed ZachHoppinen closed 4 months ago

ZachHoppinen commented 4 months ago

Hello,

Feel free to close if this isn't helpful but when I use this great package with large xarray dataarrays the date text in the corner get very small and illegible. This push:

Credit to this slack exchange answer: https://stackoverflow.com/questions/4902198/pil-how-to-scale-text-size-in-relation-to-the-size-of-the-image

One weird thing I found was the background box was too short vertically after these changes so I added a 1.6x multiplier to the height to make the text work but I suspect I may just be missing something there.

Cheers! Zach

ZachHoppinen commented 4 months ago

Just noticed this may resolve #18 to some extent as well.

gjoseph92 commented 4 months ago

@ZachHoppinen I'll leave this for you to test out on your data, but I think it's good to go, so once you confirm I'll merge and cut a release!

ZachHoppinen commented 4 months ago

@gjoseph92 Just ran this on my data for a few different font sizes and fractions and it looks awesome now! Thanks for cleaning that all up and for this super cool project!

gjoseph92 commented 4 months ago

Great to hear! Thanks for the contribution and figuring out the core change!