juseg / hyoga

Paleoglacier modelling framework
https://hyoga.io
GNU General Public License v3.0
8 stars 0 forks source link

Plotting vectors freezes axes limits. #71

Open juseg opened 1 year ago

juseg commented 1 year ago

Hyoga circumvents auto-scaling by freezing axes bounds when plotting global paleoglacier and Natural Earth vectors. A better approach will be to leave auto-scaling on but exclude the vectors using autolim or is_autoscale in future versions of matplotlib and geopandas:

This is the problematic code:

https://github.com/juseg/hyoga/blob/247ebe135b97a9117c1a62becccea5753fbcbb10/hyoga/plot/datasets.py#L513-L515 https://github.com/juseg/hyoga/blob/247ebe135b97a9117c1a62becccea5753fbcbb10/hyoga/plot/datasets.py#L547-L549

juseg commented 3 weeks ago

A new autolim keyword argument allows disabling auto-scaling for linestrings and polygon plots, but not for points due to the upstream Matplotlib issue. I opened a follow-up GeoPandas issue for point geometries (e.g. Natural Earth cities) at:

The new code will be part of GeoPandas 1.0.0. When that is out I think we should use autolim=False whenever possible while keeping current behaviour for other cases, including the support for geopandas<1.0.0.