I have data (link) in the form given below:
Input data format
Header: 'x' 'y' 'a' 'b'
x1 , y1 , ... (data)
x2 , y2 , ... (data)
x3 , y3 , ... (data)
: : :
xn-2, yn-2, ... (data)
xn-1, yn-1, ... (data)
xn , yn , ... (data)
They are non uniformly spaced grids, and I want to plot a filled contour that is colored by a, b in this case. Because of the arrangement of the points and non uniformity, I cannot use np.meshgrid
(correct me if I am wrong). How do I plot a column vector as a contour with non uniform grid points that are also column vectors?
MWE
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('./plot_data.dat', skip_header=1, dtype = None, delimiter = '\t')
test = np.column_stack([data[:,0],data[:,1],data[:,3]])
plt.imshow(test)
plt.xlim([np.min(data[:,0]), np.max(data[:,0])])
plt.ylim([np.min(data[:,1]), np.max(data[:,1])])
plt.show()