Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Python中的数据文件绘制二维等高线图_Python_Pandas_Matplotlib - Fatal编程技术网

使用Python中的数据文件绘制二维等高线图

使用Python中的数据文件绘制二维等高线图,python,pandas,matplotlib,Python,Pandas,Matplotlib,我有一个数据文件,它由5行4642列组成。我想创建一个轮廓文件使用2,3和5行。我尝试编写一个简单的Python代码,如下所示: import numpy as np import pandas as pd import matplotlib.pyplot as plt import math df = pd.read_csv('inlet_v.csv', skiprows=1, header = None) tt = plt.contourf(df.iloc[:,1], df.iloc

我有一个数据文件,它由5行4642列组成。我想创建一个轮廓文件使用2,3和5行。我尝试编写一个简单的Python代码,如下所示:

import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt
import math 

df = pd.read_csv('inlet_v.csv', skiprows=1, header = None)
tt = plt.contourf(df.iloc[:,1], df.iloc[:,2], df.iloc[:,4])

plt.show()
0   0.02    0   0.12674 5.4805E-05
0   0.021   0   0.12674 5.7583E-05
0   0.02    0.03    0.12674 2.1107E-05
0   0.021   0.03    0.12674 2.2177E-05
0   0.02098 0   0.12674 0.00011227
0   0.02096 0   0.12674 0.00022133
0   0.02094 0   0.12674 0.00032951
0   0.02092 0   0.12674 0.00043639
0   0.0209  0   0.12674 0.00054155
0   0.02088 0   0.12674 0.00064457
0   0.02086 0   0.12674 0.00074506
0   0.02084 0   0.12674 0.00084261
0   0.02082 0   0.12674 0.00093683
0   0.0208  0   0.12674 0.0010274
0   0.02078 0   0.12674 0.0011138
0   0.02076 0   0.12674 0.0011959
0   0.02074 0   0.12674 0.0012733
0   0.02072 0   0.12674 0.0013457
0   0.0207  0   0.12674 0.0014127
0   0.02068 0   0.12674 0.0014742
0   0.02066 0   0.12674 0.0015299
0   0.02064 0   0.12674 0.0015795
0   0.02062 0   0.12674 0.0016229
0   0.0206  0   0.12674 0.0016599
0   0.02058 0   0.12674 0.0016904
0   0.02056 0   0.12674 0.0017142
0   0.02054 0   0.12674 0.0017312
0   0.02052 0   0.12674 0.0017414
0   0.0205  0   0.12674 0.0017448
0   0.02048 0   0.12674 0.0017413
0   0.02046 0   0.12674 0.0017309
0   0.02044 0   0.12674 0.0017137
0   0.02042 0   0.12674 0.0016897
0   0.0204  0   0.12674 0.0016591
0   0.02038 0   0.12674 0.0016219
0   0.02036 0   0.12674 0.0015783
0   0.02034 0   0.12674 0.0015285
0   0.02032 0   0.12674 0.0014727
0   0.0203  0   0.12674 0.0014111
0   0.02028 0   0.12674 0.0013439
0   0.02026 0   0.12674 0.0012714
0   0.02024 0   0.12674 0.0011939
0   0.02022 0   0.12674 0.0011117
0   0.0202  0   0.12674 0.0010251
0   0.02018 0   0.12674 0.00093448
0   0.02016 0   0.12674 0.00084017
0   0.02014 0   0.12674 0.00074254
0   0.02012 0   0.12674 0.00064199
0   0.0201  0   0.12674 0.00053891
0   0.02008 0   0.12674 0.0004337
0   0.02006 0   0.12674 0.00032678
0   0.02004 0   0.12674 0.00021857
0   0.02002 0   0.12674 0.0001095
0   0.02002 0.03    0.12674 4.2172E-05
0   0.02004 0.03    0.12674 8.4178E-05
0   0.02006 0.03    0.12674 0.00012585
0   0.02008 0.03    0.12674 0.00016703
0   0.0201  0.03    0.12674 0.00020755
0   0.02012 0.03    0.12674 0.00024725
0   0.02014 0.03    0.12674 0.00028598
0   0.02016 0.03    0.12674 0.00032358
0   0.02018 0.03    0.12674 0.0003599
0   0.0202  0.03    0.12674 0.0003948
0   0.02022 0.03    0.12674 0.00042815
0   0.02024 0.03    0.12674 0.00045981
0   0.02026 0.03    0.12674 0.00048966
0   0.02028 0.03    0.12674 0.00051757
0   0.0203  0.03    0.12674 0.00054345
0   0.02032 0.03    0.12674 0.00056718
0   0.02034 0.03    0.12674 0.00058868
0   0.02036 0.03    0.12674 0.00060786
0   0.02038 0.03    0.12674 0.00062463
0   0.0204  0.03    0.12674 0.00063895
0   0.02042 0.03    0.12674 0.00065075
0   0.02044 0.03    0.12674 0.00065998
0   0.02046 0.03    0.12674 0.00066661
0   0.02048 0.03    0.12674 0.00067061
0   0.0205  0.03    0.12674 0.00067197
0   0.02052 0.03    0.12674 0.00067068
0   0.02054 0.03    0.12674 0.00066675
0   0.02056 0.03    0.12674 0.00066018
0   0.02058 0.03    0.12674 0.00065102
0   0.0206  0.03    0.12674 0.00063928
0   0.02062 0.03    0.12674 0.00062503
0   0.02064 0.03    0.12674 0.00060831
0   0.02066 0.03    0.12674 0.00058919
0   0.02068 0.03    0.12674 0.00056776
0   0.0207  0.03    0.12674 0.00054408
0   0.02072 0.03    0.12674 0.00051825
0   0.02074 0.03    0.12674 0.00049039
0   0.02076 0.03    0.12674 0.00046059
0   0.02078 0.03    0.12674 0.00042897
0   0.0208  0.03    0.12674 0.00039567
0   0.02082 0.03    0.12674 0.0003608
0   0.02084 0.03    0.12674 0.00032451
0   0.02086 0.03    0.12674 0.00028694
0   0.02088 0.03    0.12674 0.00024825
0   0.0209  0.03    0.12674 0.00020857
0   0.02092 0.03    0.12674 0.00016807
0   0.02094 0.03    0.12674 0.0001269
0   0.02096 0.03    0.12674 8.524E-05
0   0.02098 0.03    0.12674 4.324E-05
0   0.02    0.00033333  0.12674 6.2219E-05
0   0.02    0.00066667  0.12674 6.1847E-05
0   0.02    0.001   0.12674 3.3238E-05
0   0.02    0.0013333   0.12674 -1.1494E-05
0   0.02    0.0016667   0.12674 -5.0586E-05
0   0.02    0.002   0.12674 -6.5667E-05
0   0.02    0.0023333   0.12674 -5.2608E-05
0   0.02    0.0026667   0.12674 -2.3248E-05
0   0.02    0.003   0.12674 2.9907E-06
0   0.02    0.0033333   0.12674 1.1943E-05
0   0.02    0.0036667   0.12674 3.5166E-06
0   0.02    0.004   0.12674 -9.2539E-06
0   0.02    0.0043333   0.12674 -1.0113E-05
0   0.02    0.0046667   0.12674 8.3196E-06
0   0.02    0.005   0.12674 3.8492E-05
0   0.02    0.0053333   0.12674 6.2114E-05
0   0.02    0.0056667   0.12674 6.1961E-05
0   0.02    0.006   0.12674 3.3541E-05
0   0.02    0.0063333   0.12674 -1.1146E-05
0   0.02    0.0066667   0.12674 -5.0363E-05
0   0.02    0.007   0.12674 -6.5664E-05
0   0.02    0.0073333   0.12674 -5.2792E-05
0   0.02    0.0076667   0.12674 -2.3484E-05
0   0.02    0.008   0.12674 2.8461E-06
0   0.02    0.0083333   0.12674 1.195E-05
0   0.02    0.0086667   0.12674 3.6189E-06
0   0.02    0.009   0.12674 -9.184E-06
0   0.02    0.0093333   0.12674 -1.0179E-05
0   0.02    0.0096667   0.12674 8.1163E-06
0   0.02    0.01    0.12674 3.8261E-05
0   0.02    0.010333    0.12674 6.2008E-05
0   0.02    0.010667    0.12674 6.2074E-05
0   0.02    0.011   0.12674 3.3842E-05
0   0.02    0.011333    0.12674 -1.0798E-05
0   0.02    0.011667    0.12674 -5.0139E-05
0   0.02    0.012   0.12674 -6.566E-05
0   0.02    0.012333    0.12674 -5.2975E-05
0   0.02    0.012667    0.12674 -2.372E-05
0   0.02    0.013   0.12674 2.7004E-06
0   0.02    0.013333    0.12674 1.1957E-05
0   0.02    0.013667    0.12674 3.721E-06
0   0.02    0.014   0.12674 -9.1134E-06
0   0.02    0.014333    0.12674 -1.0244E-05
0   0.02    0.014667    0.12674 7.9138E-06
0   0.02    0.015   0.12674 3.803E-05
0   0.02    0.015333    0.12674 6.1901E-05
0   0.02    0.015667    0.12674 6.2186E-05
import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import math 

df = pd.read_csv('inlet_v.csv', skiprows=1, header = None)

plt.figure(1)
tt = plt.tricontourf(df.iloc[:,2], df.iloc[:,1], df.iloc[:,4], cmap="jet")
plt.show()
但正如预期的那样,由于数据中的“z”或第三个条目不是2D,因此它是抛出和错误,表示:

 tt = plt.contourf(df.iloc[:,1], df.iloc[:,2], df.iloc[:,4])
TypeError: Input z must be a 2D array.

任何意见/建议都会大有帮助。数据如下所示:

import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt
import math 

df = pd.read_csv('inlet_v.csv', skiprows=1, header = None)
tt = plt.contourf(df.iloc[:,1], df.iloc[:,2], df.iloc[:,4])

plt.show()
0   0.02    0   0.12674 5.4805E-05
0   0.021   0   0.12674 5.7583E-05
0   0.02    0.03    0.12674 2.1107E-05
0   0.021   0.03    0.12674 2.2177E-05
0   0.02098 0   0.12674 0.00011227
0   0.02096 0   0.12674 0.00022133
0   0.02094 0   0.12674 0.00032951
0   0.02092 0   0.12674 0.00043639
0   0.0209  0   0.12674 0.00054155
0   0.02088 0   0.12674 0.00064457
0   0.02086 0   0.12674 0.00074506
0   0.02084 0   0.12674 0.00084261
0   0.02082 0   0.12674 0.00093683
0   0.0208  0   0.12674 0.0010274
0   0.02078 0   0.12674 0.0011138
0   0.02076 0   0.12674 0.0011959
0   0.02074 0   0.12674 0.0012733
0   0.02072 0   0.12674 0.0013457
0   0.0207  0   0.12674 0.0014127
0   0.02068 0   0.12674 0.0014742
0   0.02066 0   0.12674 0.0015299
0   0.02064 0   0.12674 0.0015795
0   0.02062 0   0.12674 0.0016229
0   0.0206  0   0.12674 0.0016599
0   0.02058 0   0.12674 0.0016904
0   0.02056 0   0.12674 0.0017142
0   0.02054 0   0.12674 0.0017312
0   0.02052 0   0.12674 0.0017414
0   0.0205  0   0.12674 0.0017448
0   0.02048 0   0.12674 0.0017413
0   0.02046 0   0.12674 0.0017309
0   0.02044 0   0.12674 0.0017137
0   0.02042 0   0.12674 0.0016897
0   0.0204  0   0.12674 0.0016591
0   0.02038 0   0.12674 0.0016219
0   0.02036 0   0.12674 0.0015783
0   0.02034 0   0.12674 0.0015285
0   0.02032 0   0.12674 0.0014727
0   0.0203  0   0.12674 0.0014111
0   0.02028 0   0.12674 0.0013439
0   0.02026 0   0.12674 0.0012714
0   0.02024 0   0.12674 0.0011939
0   0.02022 0   0.12674 0.0011117
0   0.0202  0   0.12674 0.0010251
0   0.02018 0   0.12674 0.00093448
0   0.02016 0   0.12674 0.00084017
0   0.02014 0   0.12674 0.00074254
0   0.02012 0   0.12674 0.00064199
0   0.0201  0   0.12674 0.00053891
0   0.02008 0   0.12674 0.0004337
0   0.02006 0   0.12674 0.00032678
0   0.02004 0   0.12674 0.00021857
0   0.02002 0   0.12674 0.0001095
0   0.02002 0.03    0.12674 4.2172E-05
0   0.02004 0.03    0.12674 8.4178E-05
0   0.02006 0.03    0.12674 0.00012585
0   0.02008 0.03    0.12674 0.00016703
0   0.0201  0.03    0.12674 0.00020755
0   0.02012 0.03    0.12674 0.00024725
0   0.02014 0.03    0.12674 0.00028598
0   0.02016 0.03    0.12674 0.00032358
0   0.02018 0.03    0.12674 0.0003599
0   0.0202  0.03    0.12674 0.0003948
0   0.02022 0.03    0.12674 0.00042815
0   0.02024 0.03    0.12674 0.00045981
0   0.02026 0.03    0.12674 0.00048966
0   0.02028 0.03    0.12674 0.00051757
0   0.0203  0.03    0.12674 0.00054345
0   0.02032 0.03    0.12674 0.00056718
0   0.02034 0.03    0.12674 0.00058868
0   0.02036 0.03    0.12674 0.00060786
0   0.02038 0.03    0.12674 0.00062463
0   0.0204  0.03    0.12674 0.00063895
0   0.02042 0.03    0.12674 0.00065075
0   0.02044 0.03    0.12674 0.00065998
0   0.02046 0.03    0.12674 0.00066661
0   0.02048 0.03    0.12674 0.00067061
0   0.0205  0.03    0.12674 0.00067197
0   0.02052 0.03    0.12674 0.00067068
0   0.02054 0.03    0.12674 0.00066675
0   0.02056 0.03    0.12674 0.00066018
0   0.02058 0.03    0.12674 0.00065102
0   0.0206  0.03    0.12674 0.00063928
0   0.02062 0.03    0.12674 0.00062503
0   0.02064 0.03    0.12674 0.00060831
0   0.02066 0.03    0.12674 0.00058919
0   0.02068 0.03    0.12674 0.00056776
0   0.0207  0.03    0.12674 0.00054408
0   0.02072 0.03    0.12674 0.00051825
0   0.02074 0.03    0.12674 0.00049039
0   0.02076 0.03    0.12674 0.00046059
0   0.02078 0.03    0.12674 0.00042897
0   0.0208  0.03    0.12674 0.00039567
0   0.02082 0.03    0.12674 0.0003608
0   0.02084 0.03    0.12674 0.00032451
0   0.02086 0.03    0.12674 0.00028694
0   0.02088 0.03    0.12674 0.00024825
0   0.0209  0.03    0.12674 0.00020857
0   0.02092 0.03    0.12674 0.00016807
0   0.02094 0.03    0.12674 0.0001269
0   0.02096 0.03    0.12674 8.524E-05
0   0.02098 0.03    0.12674 4.324E-05
0   0.02    0.00033333  0.12674 6.2219E-05
0   0.02    0.00066667  0.12674 6.1847E-05
0   0.02    0.001   0.12674 3.3238E-05
0   0.02    0.0013333   0.12674 -1.1494E-05
0   0.02    0.0016667   0.12674 -5.0586E-05
0   0.02    0.002   0.12674 -6.5667E-05
0   0.02    0.0023333   0.12674 -5.2608E-05
0   0.02    0.0026667   0.12674 -2.3248E-05
0   0.02    0.003   0.12674 2.9907E-06
0   0.02    0.0033333   0.12674 1.1943E-05
0   0.02    0.0036667   0.12674 3.5166E-06
0   0.02    0.004   0.12674 -9.2539E-06
0   0.02    0.0043333   0.12674 -1.0113E-05
0   0.02    0.0046667   0.12674 8.3196E-06
0   0.02    0.005   0.12674 3.8492E-05
0   0.02    0.0053333   0.12674 6.2114E-05
0   0.02    0.0056667   0.12674 6.1961E-05
0   0.02    0.006   0.12674 3.3541E-05
0   0.02    0.0063333   0.12674 -1.1146E-05
0   0.02    0.0066667   0.12674 -5.0363E-05
0   0.02    0.007   0.12674 -6.5664E-05
0   0.02    0.0073333   0.12674 -5.2792E-05
0   0.02    0.0076667   0.12674 -2.3484E-05
0   0.02    0.008   0.12674 2.8461E-06
0   0.02    0.0083333   0.12674 1.195E-05
0   0.02    0.0086667   0.12674 3.6189E-06
0   0.02    0.009   0.12674 -9.184E-06
0   0.02    0.0093333   0.12674 -1.0179E-05
0   0.02    0.0096667   0.12674 8.1163E-06
0   0.02    0.01    0.12674 3.8261E-05
0   0.02    0.010333    0.12674 6.2008E-05
0   0.02    0.010667    0.12674 6.2074E-05
0   0.02    0.011   0.12674 3.3842E-05
0   0.02    0.011333    0.12674 -1.0798E-05
0   0.02    0.011667    0.12674 -5.0139E-05
0   0.02    0.012   0.12674 -6.566E-05
0   0.02    0.012333    0.12674 -5.2975E-05
0   0.02    0.012667    0.12674 -2.372E-05
0   0.02    0.013   0.12674 2.7004E-06
0   0.02    0.013333    0.12674 1.1957E-05
0   0.02    0.013667    0.12674 3.721E-06
0   0.02    0.014   0.12674 -9.1134E-06
0   0.02    0.014333    0.12674 -1.0244E-05
0   0.02    0.014667    0.12674 7.9138E-06
0   0.02    0.015   0.12674 3.803E-05
0   0.02    0.015333    0.12674 6.1901E-05
0   0.02    0.015667    0.12674 6.2186E-05
import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import math 

df = pd.read_csv('inlet_v.csv', skiprows=1, header = None)

plt.figure(1)
tt = plt.tricontourf(df.iloc[:,2], df.iloc[:,1], df.iloc[:,4], cmap="jet")
plt.show()
使用@JohanC()注释,我现在可以正确地绘制它,代码如下所示:

import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt
import math 

df = pd.read_csv('inlet_v.csv', skiprows=1, header = None)
tt = plt.contourf(df.iloc[:,1], df.iloc[:,2], df.iloc[:,4])

plt.show()
0   0.02    0   0.12674 5.4805E-05
0   0.021   0   0.12674 5.7583E-05
0   0.02    0.03    0.12674 2.1107E-05
0   0.021   0.03    0.12674 2.2177E-05
0   0.02098 0   0.12674 0.00011227
0   0.02096 0   0.12674 0.00022133
0   0.02094 0   0.12674 0.00032951
0   0.02092 0   0.12674 0.00043639
0   0.0209  0   0.12674 0.00054155
0   0.02088 0   0.12674 0.00064457
0   0.02086 0   0.12674 0.00074506
0   0.02084 0   0.12674 0.00084261
0   0.02082 0   0.12674 0.00093683
0   0.0208  0   0.12674 0.0010274
0   0.02078 0   0.12674 0.0011138
0   0.02076 0   0.12674 0.0011959
0   0.02074 0   0.12674 0.0012733
0   0.02072 0   0.12674 0.0013457
0   0.0207  0   0.12674 0.0014127
0   0.02068 0   0.12674 0.0014742
0   0.02066 0   0.12674 0.0015299
0   0.02064 0   0.12674 0.0015795
0   0.02062 0   0.12674 0.0016229
0   0.0206  0   0.12674 0.0016599
0   0.02058 0   0.12674 0.0016904
0   0.02056 0   0.12674 0.0017142
0   0.02054 0   0.12674 0.0017312
0   0.02052 0   0.12674 0.0017414
0   0.0205  0   0.12674 0.0017448
0   0.02048 0   0.12674 0.0017413
0   0.02046 0   0.12674 0.0017309
0   0.02044 0   0.12674 0.0017137
0   0.02042 0   0.12674 0.0016897
0   0.0204  0   0.12674 0.0016591
0   0.02038 0   0.12674 0.0016219
0   0.02036 0   0.12674 0.0015783
0   0.02034 0   0.12674 0.0015285
0   0.02032 0   0.12674 0.0014727
0   0.0203  0   0.12674 0.0014111
0   0.02028 0   0.12674 0.0013439
0   0.02026 0   0.12674 0.0012714
0   0.02024 0   0.12674 0.0011939
0   0.02022 0   0.12674 0.0011117
0   0.0202  0   0.12674 0.0010251
0   0.02018 0   0.12674 0.00093448
0   0.02016 0   0.12674 0.00084017
0   0.02014 0   0.12674 0.00074254
0   0.02012 0   0.12674 0.00064199
0   0.0201  0   0.12674 0.00053891
0   0.02008 0   0.12674 0.0004337
0   0.02006 0   0.12674 0.00032678
0   0.02004 0   0.12674 0.00021857
0   0.02002 0   0.12674 0.0001095
0   0.02002 0.03    0.12674 4.2172E-05
0   0.02004 0.03    0.12674 8.4178E-05
0   0.02006 0.03    0.12674 0.00012585
0   0.02008 0.03    0.12674 0.00016703
0   0.0201  0.03    0.12674 0.00020755
0   0.02012 0.03    0.12674 0.00024725
0   0.02014 0.03    0.12674 0.00028598
0   0.02016 0.03    0.12674 0.00032358
0   0.02018 0.03    0.12674 0.0003599
0   0.0202  0.03    0.12674 0.0003948
0   0.02022 0.03    0.12674 0.00042815
0   0.02024 0.03    0.12674 0.00045981
0   0.02026 0.03    0.12674 0.00048966
0   0.02028 0.03    0.12674 0.00051757
0   0.0203  0.03    0.12674 0.00054345
0   0.02032 0.03    0.12674 0.00056718
0   0.02034 0.03    0.12674 0.00058868
0   0.02036 0.03    0.12674 0.00060786
0   0.02038 0.03    0.12674 0.00062463
0   0.0204  0.03    0.12674 0.00063895
0   0.02042 0.03    0.12674 0.00065075
0   0.02044 0.03    0.12674 0.00065998
0   0.02046 0.03    0.12674 0.00066661
0   0.02048 0.03    0.12674 0.00067061
0   0.0205  0.03    0.12674 0.00067197
0   0.02052 0.03    0.12674 0.00067068
0   0.02054 0.03    0.12674 0.00066675
0   0.02056 0.03    0.12674 0.00066018
0   0.02058 0.03    0.12674 0.00065102
0   0.0206  0.03    0.12674 0.00063928
0   0.02062 0.03    0.12674 0.00062503
0   0.02064 0.03    0.12674 0.00060831
0   0.02066 0.03    0.12674 0.00058919
0   0.02068 0.03    0.12674 0.00056776
0   0.0207  0.03    0.12674 0.00054408
0   0.02072 0.03    0.12674 0.00051825
0   0.02074 0.03    0.12674 0.00049039
0   0.02076 0.03    0.12674 0.00046059
0   0.02078 0.03    0.12674 0.00042897
0   0.0208  0.03    0.12674 0.00039567
0   0.02082 0.03    0.12674 0.0003608
0   0.02084 0.03    0.12674 0.00032451
0   0.02086 0.03    0.12674 0.00028694
0   0.02088 0.03    0.12674 0.00024825
0   0.0209  0.03    0.12674 0.00020857
0   0.02092 0.03    0.12674 0.00016807
0   0.02094 0.03    0.12674 0.0001269
0   0.02096 0.03    0.12674 8.524E-05
0   0.02098 0.03    0.12674 4.324E-05
0   0.02    0.00033333  0.12674 6.2219E-05
0   0.02    0.00066667  0.12674 6.1847E-05
0   0.02    0.001   0.12674 3.3238E-05
0   0.02    0.0013333   0.12674 -1.1494E-05
0   0.02    0.0016667   0.12674 -5.0586E-05
0   0.02    0.002   0.12674 -6.5667E-05
0   0.02    0.0023333   0.12674 -5.2608E-05
0   0.02    0.0026667   0.12674 -2.3248E-05
0   0.02    0.003   0.12674 2.9907E-06
0   0.02    0.0033333   0.12674 1.1943E-05
0   0.02    0.0036667   0.12674 3.5166E-06
0   0.02    0.004   0.12674 -9.2539E-06
0   0.02    0.0043333   0.12674 -1.0113E-05
0   0.02    0.0046667   0.12674 8.3196E-06
0   0.02    0.005   0.12674 3.8492E-05
0   0.02    0.0053333   0.12674 6.2114E-05
0   0.02    0.0056667   0.12674 6.1961E-05
0   0.02    0.006   0.12674 3.3541E-05
0   0.02    0.0063333   0.12674 -1.1146E-05
0   0.02    0.0066667   0.12674 -5.0363E-05
0   0.02    0.007   0.12674 -6.5664E-05
0   0.02    0.0073333   0.12674 -5.2792E-05
0   0.02    0.0076667   0.12674 -2.3484E-05
0   0.02    0.008   0.12674 2.8461E-06
0   0.02    0.0083333   0.12674 1.195E-05
0   0.02    0.0086667   0.12674 3.6189E-06
0   0.02    0.009   0.12674 -9.184E-06
0   0.02    0.0093333   0.12674 -1.0179E-05
0   0.02    0.0096667   0.12674 8.1163E-06
0   0.02    0.01    0.12674 3.8261E-05
0   0.02    0.010333    0.12674 6.2008E-05
0   0.02    0.010667    0.12674 6.2074E-05
0   0.02    0.011   0.12674 3.3842E-05
0   0.02    0.011333    0.12674 -1.0798E-05
0   0.02    0.011667    0.12674 -5.0139E-05
0   0.02    0.012   0.12674 -6.566E-05
0   0.02    0.012333    0.12674 -5.2975E-05
0   0.02    0.012667    0.12674 -2.372E-05
0   0.02    0.013   0.12674 2.7004E-06
0   0.02    0.013333    0.12674 1.1957E-05
0   0.02    0.013667    0.12674 3.721E-06
0   0.02    0.014   0.12674 -9.1134E-06
0   0.02    0.014333    0.12674 -1.0244E-05
0   0.02    0.014667    0.12674 7.9138E-06
0   0.02    0.015   0.12674 3.803E-05
0   0.02    0.015333    0.12674 6.1901E-05
0   0.02    0.015667    0.12674 6.2186E-05
import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import math 

df = pd.read_csv('inlet_v.csv', skiprows=1, header = None)

plt.figure(1)
tt = plt.tricontourf(df.iloc[:,2], df.iloc[:,1], df.iloc[:,4], cmap="jet")
plt.show()

相应的图如附图所示。再次感谢@JohanC的帮助

对于不在网格上的x和y值,您需要
plt.tricontourf(…)
。@JohanC非常感谢,非常适合我。