plot annotates cell indices incorrectly

Issue #440 resolved
Prof Garth Wells created an issue

Plotting a mesh and using the keyboard shortcut 'c' appears to annotate facets rather than cells. From the documentation, it should annotate cells.

To reproduce:

from dolfin import *
mesh = UnitCubeMesh(1,1,1)
mesh.num_cells()
plot(mesh, interactive=True)

and press 'c' in the plot window. The indices run (0, 11), rather than (0, 5).

Originally reported in https://bitbucket.org/fenics-project/dolfin/issue/439

Comments (6)

  1. Benjamin Dam Kehlet

    The reason, I think, is that the plotter code extracts the boundary mesh (which indeed has 12 cells) and plots it. Does it make sense to annotate indices in 3D when only the boundary is being displayed, or should this perhaps be a "2D only" feature?

  2. Anders Logg (Chalmers)

    Yes, this is confusing. If one wants to know the indices of the cells of the boundary mesh in 3D, one can just extract the boundary mesh, then plot and press c. So I suggest disabling this features in 3D.

  3. Log in to comment