pastas / pastastore

:spaghetti: :convenience_store: Tools for managing timeseries and Pastas models
https://pastastore.readthedocs.io
MIT License
15 stars 4 forks source link

Automated Label Placement #61

Closed martinvonk closed 2 years ago

martinvonk commented 2 years ago

This pull request adds an option for smart label placement using the adjustText package. Currently labels are only placed using an offset but that can cause labels to overlap: Overzichtskaart_Meetnet_Aamsveen_old_labels The adjust_text function from adjustText uses an iterative adjustment for label positions to minimize overlaps. Overzichtskaart_Meetnet_Aamsveen_new_labels In this example the adjust_text function is relatively slow (<1min) but in problems with fewer points and shorter label strings it is much faster

This does create an extra dependency but the adjustText package is really small and we already support all it's dependencies.