You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or add *mappable* to an Axes.
This is due to a change in recent versions of matplotlib where fig.colorbar will not guess anymore from which ax it will steal space. See for example matplotlib/matplotlib#23973.
Temporary fixes:
either roll back to matplotlib 5.1
use viewer without the colorbar as viewer = MatplotlibViewer(vars=phi, datamin=-0, datamax=0, title="Grid2D test", axes=ax, colorbar=None)
change in fipy code:
I am new to fipy, but I suspect that passing explicitly the ax in this part of the code would solve the problem:
As mentioned in issue #1006 and #1009, trying to view a
CellVariable
usingviewer = MatplotlibViewer(vars=varname, datamin=-0, datamax=0, title="Grid2D test", axes=ax)
or
viewer = Viewer(vars=phi, datamin=-1, datamax=1.)
will result in
ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or add *mappable* to an Axes.
See for example https://pages.nist.gov/fipy/en/latest/generated/examples.diffusion.circle.html#module-examples.diffusion.circle.
This is due to a change in recent versions of matplotlib where
fig.colorbar
will not guess anymore from whichax
it will steal space. See for example matplotlib/matplotlib#23973.Temporary fixes:
viewer = MatplotlibViewer(vars=phi, datamin=-0, datamax=0, title="Grid2D test", axes=ax, colorbar=None)
change in fipy code:
I am new to fipy, but I suspect that passing explicitly the ax in this part of the code would solve the problem:
fipy/fipy/viewers/matplotlibViewer/abstractMatplotlibViewer.py
Lines 120 to 123 in e7afd1a
maybe as:
I have not tried yet tough.Tried it and it works perfectly it seems. Will open a pull request.
The text was updated successfully, but these errors were encountered: