Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 11c7af9

Browse files
committed
MEP12 on tricontour_smooth_user.py
Changes: 1. Explicitly stated Triangulation and UniformTriRefiner import from matplotlib.tri.
1 parent 0a5314a commit 11c7af9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/pylab_examples/tricontour_smooth_user.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Demonstrates high-resolution tricontouring on user-defined triangular grids
33
with matplotlib.tri.UniformTriRefiner
44
"""
5-
from matplotlib.tri import Triangulation, UniformTriRefiner
5+
import matplotlib.tri as tri
66
import matplotlib.pyplot as plt
77
import matplotlib.cm as cm
88
import numpy as np
@@ -43,7 +43,7 @@ def function_z(x, y):
4343
# Now create the Triangulation.
4444
# (Creating a Triangulation without specifying the triangles results in the
4545
# Delaunay triangulation of the points.)
46-
triang = Triangulation(x, y)
46+
triang = tri.Triangulation(x, y)
4747

4848
# Mask off unwanted triangles.
4949
xmid = x[triang.triangles].mean(axis=1)
@@ -54,7 +54,7 @@ def function_z(x, y):
5454
#-----------------------------------------------------------------------------
5555
# Refine data
5656
#-----------------------------------------------------------------------------
57-
refiner = UniformTriRefiner(triang)
57+
refiner = tri.UniformTriRefiner(triang)
5858
tri_refi, z_test_refi = refiner.refine_field(z, subdiv=3)
5959

6060
#-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)