EOmaps
EOmaps copied to clipboard
Creating colorbars on not yet visible layers results in axes size changes and requires re-draw of all cached layers!
Describe the bug Cached layers must be re-drawn if a new colorbar is added that results in a change of the axes-sizes.
To Reproduce
from eomaps import Maps
m = Maps()
m.add_feature.preset.ocean()
m.f.canvas.draw() # to draw and cache the layer
m2 = m.new_layer("not yet visible layer")
m2.set_data([1,2,3], [1,2,3], [1,2,3])
m2.plot_map(set_extent=False)
m2.add_colorbar()
Possible workaround:
Trigger an explicit re-draw after adding the colorbar
m.redraw()