22Demonstrates high-resolution tricontouring on user-defined triangular grids
33with matplotlib.tri.UniformTriRefiner
44"""
5- from matplotlib .tri import Triangulation , UniformTriRefiner
5+ import matplotlib .tri as tri
66import matplotlib .pyplot as plt
77import matplotlib .cm as cm
88import 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.
4949xmid = 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 )
5858tri_refi , z_test_refi = refiner .refine_field (z , subdiv = 3 )
5959
6060#-----------------------------------------------------------------------------
0 commit comments