juseg / hyoga

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

Fix auto-centering of altitude colormaps. #27

Closed juseg closed 1 year ago

juseg commented 1 year ago

I realize the documentation are dotted with center=False. This is because xarray defaults to centering any image plot where data span negative and positive values, however this is not really appropriate for glacier-depressed bedrock elevation typically ranging from slightly below sea level to the mountain tops. I can think of two ways to fix this: use sealevel=-120 and possibly the 'Elevational' instead of 'Topographic' colormap, or changing bedrock_altitude() and friends' default behaviour.

juseg commented 1 year ago

I am backtracking on this. I think I want to keep hyoga as consistent as possible with xarray. The center kwarg is not the most intuitive though. Besides I realized that sealevel=sealevel is redundant with center=sealevel. So I am planning to:

juseg commented 1 year ago

Using vmin=-120 alone causes xarray to center the cmap between -120 and +120, so I'll stick to center=False in that case but: