@cgadal contributed a fix for this, which I just merged to `master` a few days 
ago.

https://github.com/usnistgov/fipy/pull/1088

________________________________________
From: 'Fausto Arinos de A. Barbuto' via fipy <[email protected]>
Sent: Tuesday, May 6, 2025 19:03
To: FIPY
Subject: [fipy] Matplotlib2DViewer and MatplotlibViewer errors


Hi,

Revisiting a few old scripts I realized that they no longer work as they once 
did.
Apparently, Gmsh2D meshes are not getting along too well with Matplotlib2DViewer
and MatplotlibViewer. Now I get the following error messages:

ERROR:fipy:Uncaught exception:
Traceback (most recent call last):
  File "C:\Users\faust\Documents\Programs\CFD\FiPy-3.0\Fausto\Canal6.py", line 
90, in <module>
    viewer = Matplotlib2DViewer(vars=(C), datamin=Cmin, datamax=Cmax,
  File "C:\Program 
Files\Python\lib\site-packages\fipy\viewers\matplotlibViewer\matplotlib2DViewer.py",
 line 49, in __init__
    AbstractMatplotlib2DViewer.__init__(self, vars=vars, title=title, 
figaspect=figaspect,
  File "C:\Program 
Files\Python\lib\site-packages\fipy\viewers\matplotlibViewer\abstractMatplotlibViewer.py",
 line 121, in __init__
    self._colorbar = self.fig.colorbar(mappable=self._mappable,
  File "C:\Program Files\Python\lib\site-packages\matplotlib\figure.py", line 
1273, in colorbar
    raise ValueError(
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.

But if I set:

viewer = fipy.Viewer([arguments])

Mayavi (which I don't like a whole lot) opens instead and the expected result is
produced, but I much prefer the old Matplotlib kind of dynamic plot. Another 
issue
is that a blank Matplotlib plotting window opens too, along with Mayavi, but 
nothing
is plotted but the axes. What could that be and how do I fix this?

Windows 11
Python 3.10.11
FiPy 3.4.5
Matplotlib 3.10.1
Mayavi 4.8.3.dev0
VTK 9.4.2

Thanks.

--
To unsubscribe from this group, send email to [email protected]

View this message at https://list.nist.gov/fipy

-- 
To unsubscribe from this group, send email to [email protected]

View this message at https://list.nist.gov/fipy
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to