I have a problem that needs your help. Now I have a grid data. It is composed of multiple different values. The structure is shown below. actual graphics
In fact, the graph I want to get should be composed of smooth filled surface. As shown below. The graphics i want
I provided a specific data set. Please refer. Sample data set。 this dataset is in asc format defined by "surfer" software. You can use "pykrige" to read. Use the following code to render
import sys
import matplotlib.pyplot as plt
import pykrige.kriging_tools as kt
def func(cmd):
ascFile = cmd[1]
ascFileContent = kt.read_asc_grid(ascFile)
Z = ascFileContent[0]
X = ascFileContent[1]
Y = ascFileContent[2]
print(Z)
fig = plt.figure()
ax = fig.add_subplot()
contour = plt.contourf(X,Y,Z)
#contour = plt.pcolormesh(X,Y,Z)
plt.show()
if __name__ == "__main__":
cmd=["CONTOUR_KYZQ"]
#gridFile
cmd.append(r"D:\out.grd")
func(cmd)
I used various methods, such as pcolormesh, contourf. The resulting graphics are jagged. How can I solve this problem. please help me. Thanks a lot.