Closed carsten-forty2 closed 2 years ago
I just checked this very old issue again. Seems like you can only activate the CellBrowser with the show command by block=True
but only for the second call:
import numpy as np
import pygimli as pg
from pygimli.viewer.mpl import CellBrowser
axs = pg.plt.subplots(1, 2)[1]
x = np.linspace(0, 10, 11)
mesh = pg.createGrid(x, x)
data = np.arange(mesh.cellCount())
pg.show(mesh, data, ax=axs[0])
pg.show(mesh, data[::-1], ax=axs[1], block=True)
pg.wait()
Then the cell browser only targets to the second subplot not matter which you click in.
If you connect the CellBrowser manually
pg.show(mesh, data, ax=axs[0])
CellBrowser(mesh, data, ax=axs[0])
pg.show(mesh, data[::-1], ax=axs[1])
CellBrowser(mesh, data[::-1], ax=axs[1])
the cellbrowser targets to both subplots, no matter which one you click in.
Not clear whether it can be solved easily or whether it is of importance anyway.
I guess there won't be any solution to this issue. The Cell browser only works well on a single axis figure.
Closing the issue on its four-year anniversary.
When I click on a cell in axs[0] an infobox appears in axs[0] and axs[1]. However both data values in the box are correct for both axes.
2nd related problem:
While mixing subplots with cell and node data .. the cell browser raise an unhandled exception when pressing a key.