3D objects cannot be plotted with Matplotlib backend
Issue #1087
new
The following code
import dolfin
dolfin.plot(dolfin.UnitCubeMesh(2, 2, 2))
Produces the following error message
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/henriknf/miniconda3/envs/pulse_new/lib/python3.7/site-packages/dolfin/common/plotting.py", line 438, in plot
return _plot_matplotlib(object, mesh, kwargs)
File "/Users/henriknf/miniconda3/envs/pulse_new/lib/python3.7/site-packages/dolfin/common/plotting.py", line 282, in _plot_matplotlib
ax.set_aspect('equal')
File "/Users/henriknf/miniconda3/envs/pulse_new/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 1281, in set_aspect
'It is not currently possible to manually set the aspect '
NotImplementedError: It is not currently possible to manually set the aspect on 3D axes
- FEniCS version 2019.1
- Matplotlib version 3.1.1
- Python 3.7.3
- macOS Mojave
Comments (3)
-
-
Please try to degrade your Matplotlib version by running conda install matplotlib=3.0.3 or pip3 install matplotlib=3.0.3
It works for me. I tested it.
-
According to https://github.com/matplotlib/matplotlib/issues/1077,
aspect='equal'
is actually implemented wrongly in matplotlib right now, and should not be used. So thatNotImplementedError
in the newer version of matplotlib is correct. The suggested workaround is to useax.auto_scale_xyz
(suggested here: https://github.com/matplotlib/matplotlib/issues/1077#issuecomment-15389293). I think fenics should switch to that - Log in to comment
Run into the same bug. Python 3.6.8, Ubuntu 18.04.1, brand new installation (mapplotlib also 3.1.1, FEniCS 2019.1.0)