Try tricontourf; I've attached an example.  Most of the example code is
manipulating your input data and calculating the connectivity of your grid.

I hope this helps,
Ian Thomas
import matplotlib.pyplot as plt
import numpy as np

x,y1,y2,y3,y4,stress = np.loadtxt('data.txt', skiprows=2, delimiter=',', unpack=True)

# Arrays of all the point coordinates and stresses.
n = len(x)
x = np.hstack((x,x,x,x))
y = np.hstack((y1,y2,y3,y4))
stress = np.hstack((stress,stress,stress,stress))

# Triangle connectivity.
triangles = []
for i in range(n-1):
  triangles.append([i,i+1,n+i])
  triangles.append([i+1,n+i+1,n+i])
  triangles.append([2*n+i,2*n+i+1,3*n+i])
  triangles.append([2*n+i+1,3*n+i+1,3*n+i])

# Plot.
plt.tricontourf(x, y, triangles, stress)
plt.colorbar()
plt.show()

<<attachment: test.png>>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to