Skip to content

tricontour hangs if duplicate points in delaunay triangulation #838

Closed
@ianthomas23

Description

@ianthomas23

As reported to matplotlib.users, passing duplicate points to tricontour can cause it to hang. Here is a minimal example:

import matplotlib.pyplot as plt
import matplotlib.tri as tri
import numpy as np
from numpy.random import uniform, seed

seed(0)
npts = 7
x = uniform(-2,2,npts)
y = uniform(-2,2,npts)
z = x*np.exp(-x**2-y**2)

y[1:2] = y[0]  # Duplicate points make tricontour hang!
x[1:2] = x[0]
triang = tri.Triangulation(x, y)
plt.triplot(triang)
plt.tricontour(triang, z, 15, linewidths=0.5, colors='k')
plt.show()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions