Chandan Dey
Chandan Dey

Reputation: 23

Interpolation using matplotlib tricontourf function in python

I'm fairly new to python programming. The data I'm working with is generated by filtering process via a third party software, such that there are three arrays, x, y and z that don't need to be arranged in a 2d grid and its contour plot can be derived using tricontourf(x,y,z) or tricontour(z,y,z) function from matplotlib library.

However, the contour plot appears as shown below here. For some perspective, here is the last 50 rows of the data in three arrays (x, y and z):

33.000000   -6.000000   -0.5318
34.000000   -6.000000   -0.851
35.000000   -6.000000   -1.2272
36.000000   -6.000000   -1.5542
37.000000   -6.000000   -1.7379
38.000000   -6.000000   -1.7604
39.000000   -6.000000   -1.6388
40.000000   -6.000000   -1.4163
41.000000   -6.000000   -1.1581
42.000000   -6.000000   -0.9236
21.000000   -7.000000   -0.1708
22.000000   -7.000000   -0.071
23.000000   -7.000000   -0.1835
24.000000   -7.000000   -0.4963
25.000000   -7.000000   -0.905
26.000000   -7.000000   -1.2861
27.000000   -7.000000   -1.517
28.000000   -7.000000   -1.5054
29.000000   -7.000000   -1.2797
30.000000   -7.000000   -0.9375
31.000000   -7.000000   -0.5956
32.000000   -7.000000   -0.3749
33.000000   -7.000000   -0.3736
34.000000   -7.000000   -0.5786
35.000000   -7.000000   -0.9207
36.000000   -7.000000   -1.3124
37.000000   -7.000000   -1.6598
38.000000   -7.000000   -1.8716
39.000000   -7.000000   -1.9304
24.000000   -8.000000   -0.2939
25.000000   -8.000000   -0.702
26.000000   -8.000000   -1.1314
27.000000   -8.000000   -1.4689
28.000000   -8.000000   -1.6089
29.000000   -8.000000   -1.5114
30.000000   -8.000000   -1.2546
31.000000   -8.000000   -0.9426
32.000000   -8.000000   -0.6808
33.000000   -8.000000   -0.5766
34.000000   -8.000000   -0.6864
35.000000   -8.000000   -0.9568
36.000000   -8.000000   -1.3126
27.000000   -9.000000   -1.2369
28.000000   -9.000000   -1.4891
29.000000   -9.000000   -1.5975
30.000000   -9.000000   -1.5301
31.000000   -9.000000   -1.3623
32.000000   -9.000000   -1.1902
33.000000   -9.000000   -1.0836
30.000000   -10.000000  -1.8646

The data is stored in such a way that it triangularly projects downwards in the 2d frame. I'd like to know how to extrapolate the contours to completely fill the rectangular frame as shown below here. It is derived via surfer software using the same data set. Any help shall be highly appreciated. Preferably, kriging interpolation may be adopted.

Upvotes: 0

Views: 1414

Answers (0)

Related Questions