lundi 24 février 2014

Matplotlib's tricontour interesting behaviour

Matplotlib was happy to plot contours of triangular meshes in the past. Though they were not actually triangular, they were triangulated (by OpenFOAM's sample utility) rectangular meshes. Recently I've encountered rather strange thing, all my attempts to plot isoline of a value on a triangular mesh which initially wasn't rec ended up with while if I try to use scipy triangulation everything goes more or less OK.

Thought matplotlib and scipy use the same algorithm for triangulation appears I was wrong.

2 commentaires:

  1. The old matplotlib.delaunay module, was known to be not particularly robust.
    QHull library has recently been incorporated into matplotlib (for Delaunay triangulation) ; this is already in master but not in an official release (waiting a v 1.4.x).
    https://github.com/matplotlib/matplotlib/pull/2504

    RépondreSupprimer
    Réponses
    1. Thanks for comment. So basically they've decided to go Scipy way? (AFAIK Scipy uses QHull for triangulation)

      Supprimer