EOmaps icon indicating copy to clipboard operation
EOmaps copied to clipboard

Creating colorbars on not yet visible layers results in axes size changes and requires re-draw of all cached layers!

Open raphaelquast opened this issue 1 month ago • 0 comments

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()

raphaelquast avatar May 23 '24 09:05 raphaelquast