如何在 txt 文件中排列我的数据以便在 latex 中绘制网格?

如何在 txt 文件中排列我的数据以便在 latex 中绘制网格?

我有一个数据文件并想要为其绘制网格/曲面,但输出不合适。

\documentclass{article}
\usepackage{tikz, pgfplots}
\usepackage{pgfplots}
\begin{document}
% Preamble: \pgfplotsset{width=7cm,compat=1.11}
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,mesh/ordering=y varies,mesh/cols=16]
table {data3.txt};
\end{axis}
\end{tikzpicture}
\end{document}

我的数据是:


x y z
0   0   0
0   0   0
0   2   0
0   4   0
0   6   0
0   8   0
0   10  0
0   12  0
0   14  0
0   16  0
0   18  0
0   20  0
0   22  0
0   24  0
0   26  0
0   28  0
0   30  0
0   32  0
0   34  0
0   36  0
0   38  0
0   40  0
0   42  0
0   44  0
0   46  0
0   48  0
0   50  0
0   52  0
0   54  0
0   56  0
0   58  0
0   60  0
0   62  0
1   62  0.0200000000000000
1   0   0.0131000000000000
1   2   0.0128000000000000
1   4   0.0132000000000000
1   6   0.0142000000000000
1   8   0.0153000000000000
1   10  0.0220000000000000
1   12  0.0300000000000000
1   14  0.0405000000000000
1   16  0.0478000000000000
1   18  0.0472000000000000
1   20  0.0648000000000000
1   22  0.0597000000000000
1   24  0.0663000000000000
1   26  0.0767000000000000
1   28  0.0842000000000000
1   30  0.0876000000000000
1   32  0.0876000000000000
1   34  0.0842000000000000
1   36  0.0767000000000000
1   38  0.0663000000000000
1   40  0.0597000000000000
1   42  0.0648000000000000
1   44  0.0472000000000000
1   46  0.0478000000000000
1   48  0.0405000000000000
1   50  0.0300000000000000
1   52  0.0220000000000000
1   54  0.0153000000000000
1   56  0.0142000000000000
1   58  0.0132000000000000
1   60  0.0128000000000000
1   62  0.0131000000000000
2   62  0.0331000000000000
2   0   0.0268000000000000
2   2   0.0262000000000000
2   4   0.0271000000000000
2   6   0.0290000000000000
2   8   0.0323000000000000
2   10  0.0455000000000000
2   12  0.0644000000000000
2   14  0.0849000000000000
2   16  0.104500000000000
2   18  0.113800000000000
2   20  0.141400000000000
2   22  0.146000000000000
2   24  0.165500000000000
2   26  0.181500000000000
2   28  0.199200000000000
2   30  0.208200000000000
2   32  0.208200000000000
2   34  0.199200000000000
2   36  0.181500000000000
2   38  0.165500000000000
2   40  0.146000000000000
2   42  0.141400000000000
2   44  0.113800000000000
2   46  0.104500000000000
2   48  0.0849000000000000
2   50  0.0644000000000000
2   52  0.0455000000000000
2   54  0.0323000000000000
2   56  0.0290000000000000
2   58  0.0271000000000000
2   60  0.0262000000000000
2   62  0.0268000000000000
3   62  0.0468000000000000
3   0   0.0410000000000000
3   2   0.0410000000000000
3   4   0.0435000000000000
3   6   0.0453000000000000
3   8   0.0527000000000000
3   10  0.0731000000000000
3   12  0.102500000000000
3   14  0.137500000000000
3   16  0.168600000000000
3   18  0.191000000000000
3   20  0.232900000000000
3   22  0.247000000000000
3   24  0.276400000000000
3   26  0.306000000000000
3   28  0.332000000000000
3   30  0.344000000000000
3   32  0.344000000000000
3   34  0.332000000000000
3   36  0.306000000000000
3   38  0.276400000000000
3   40  0.247000000000000
3   42  0.232900000000000
3   44  0.191000000000000
3   46  0.168600000000000
3   48  0.137500000000000
3   50  0.102500000000000
3   52  0.0731000000000000
3   54  0.0527000000000000
3   56  0.0453000000000000
3   58  0.0435000000000000
3   60  0.0410000000000000
3   62  0.0410000000000000
4   62  0.0610000000000000
4   0   0.0546000000000000
4   2   0.0552000000000000
4   4   0.0572000000000000
4   6   0.0609000000000000
4   8   0.0703000000000000
4   10  0.0976000000000000
4   12  0.137000000000000
4   14  0.182600000000000
4   16  0.225500000000000
4   18  0.260100000000000
4   20  0.310300000000000
4   22  0.337200000000000
4   24  0.374800000000000
4   26  0.411100000000000
4   28  0.438800000000000
4   30  0.455900000000000
4   32  0.455900000000000
4   34  0.438800000000000
4   36  0.411100000000000
4   38  0.374800000000000
4   40  0.337200000000000
4   42  0.310300000000000
4   44  0.260100000000000
4   46  0.225500000000000
4   48  0.182600000000000
4   50  0.137000000000000
4   52  0.0976000000000000
4   54  0.0703000000000000
4   56  0.0609000000000000
4   58  0.0572000000000000
4   60  0.0552000000000000
4   62  0.0546000000000000
5   62  0.0746000000000000
5   0   0.0694000000000000
5   2   0.0697000000000000
5   4   0.0731000000000000
5   6   0.0776000000000000
5   8   0.0889000000000000
5   10  0.124600000000000
5   12  0.174300000000000
5   14  0.231600000000000
5   16  0.285300000000000
5   18  0.332300000000000
5   20  0.392700000000000
5   22  0.428900000000000
5   24  0.473500000000000
5   26  0.514100000000000
5   28  0.549600000000000
5   30  0.567500000000000
5   32  0.567500000000000
5   34  0.549600000000000
5   36  0.514100000000000
5   38  0.473500000000000
5   40  0.428900000000000
5   42  0.392700000000000
5   44  0.332300000000000
5   46  0.285300000000000
5   48  0.231600000000000
5   50  0.174300000000000
5   52  0.124600000000000
5   54  0.0889000000000000
5   56  0.0776000000000000
5   58  0.0731000000000000
5   60  0.0697000000000000
5   62  0.0694000000000000
6   62  0.0894000000000000
6   0   0.0836000000000000
6   2   0.0834000000000000
6   4   0.0874000000000000
6   6   0.0936000000000000
6   8   0.107600000000000
6   10  0.148400000000000
6   12  0.205200000000000
6   14  0.272300000000000
6   16  0.333400000000000
6   18  0.390100000000000
6   20  0.456900000000000
6   22  0.501600000000000
6   24  0.550200000000000
6   26  0.595600000000000
6   28  0.627200000000000
6   30  0.642200000000000
6   32  0.642200000000000
6   34  0.627200000000000
6   36  0.595600000000000
6   38  0.550200000000000
6   40  0.501600000000000
6   42  0.456900000000000
6   44  0.390100000000000
6   46  0.333400000000000
6   48  0.272300000000000
6   50  0.205200000000000
6   52  0.148400000000000
6   54  0.107600000000000
6   56  0.0936000000000000
6   58  0.0874000000000000
6   60  0.0834000000000000
6   62  0.0836000000000000
7   62  0.103600000000000
7   0   0.0987000000000000
7   2   0.0989000000000000
7   4   0.103600000000000
7   6   0.110400000000000
7   8   0.127000000000000
7   10  0.174200000000000
7   12  0.237300000000000
7   14  0.310200000000000
7   16  0.378500000000000
7   18  0.441700000000000
7   20  0.513900000000000
7   22  0.564500000000000
7   24  0.615600000000000
7   26  0.658700000000000
7   28  0.685200000000000
7   30  0.696000000000000
7   32  0.696000000000000
7   34  0.685200000000000
7   36  0.658700000000000
7   38  0.615600000000000
7   40  0.564500000000000
7   42  0.513900000000000
7   44  0.441700000000000
7   46  0.378500000000000
7   48  0.310200000000000
7   50  0.237300000000000
7   52  0.174200000000000
7   54  0.127000000000000
7   56  0.110400000000000
7   58  0.103600000000000
7   60  0.0989000000000000
7   62  0.0987000000000000
8   62  0.118700000000000
8   0   0.112900000000000
8   2   0.112700000000000
8   4   0.118000000000000
8   6   0.126300000000000
8   8   0.146000000000000
8   10  0.196700000000000
8   12  0.263300000000000
8   14  0.340600000000000
8   16  0.413700000000000
8   18  0.481900000000000
8   20  0.555000000000000
8   22  0.611300000000000
8   24  0.661600000000000
8   26  0.698600000000000
8   28  0.719500000000000
8   30  0.728900000000000
8   32  0.728900000000000
8   34  0.719500000000000
8   36  0.698600000000000
8   38  0.661600000000000
8   40  0.611300000000000
8   42  0.555000000000000
8   44  0.481900000000000
8   46  0.413700000000000
8   48  0.340600000000000
8   50  0.263300000000000
8   52  0.196700000000000
8   54  0.146000000000000
8   56  0.126300000000000
8   58  0.118000000000000
8   60  0.112700000000000
8   62  0.112900000000000
9   62  0.132900000000000
9   0   0.128400000000000
9   2   0.128600000000000
9   4   0.134500000000000
9   6   0.144100000000000
9   8   0.166600000000000
9   10  0.220400000000000
9   12  0.289500000000000
9   14  0.368300000000000
9   16  0.444400000000000
9   18  0.517100000000000
9   20  0.592900000000000
9   22  0.650800000000000
9   24  0.697400000000000
9   26  0.730000000000000
9   28  0.747900000000000
9   30  0.757000000000000
9   32  0.757000000000000
9   34  0.747900000000000
9   36  0.730000000000000
9   38  0.697400000000000
9   40  0.650800000000000
9   42  0.592900000000000
9   44  0.517100000000000
9   46  0.444400000000000
9   48  0.368300000000000
9   50  0.289500000000000
9   52  0.220400000000000
9   54  0.166600000000000
9   56  0.144100000000000
9   58  0.134500000000000
9   60  0.128600000000000
9   62  0.128400000000000
10  62  0.148400000000000
10  0   0.142200000000000
10  2   0.143300000000000
10  4   0.149200000000000
10  6   0.159900000000000
10  8   0.185000000000000
10  10  0.242100000000000
10  12  0.311500000000000
10  14  0.391100000000000
10  16  0.469100000000000
10  18  0.543800000000000
10  20  0.619700000000000
10  22  0.679800000000000
10  24  0.723200000000000
10  26  0.753600000000000
10  28  0.770500000000000
10  30  0.778600000000000
10  32  0.778600000000000
10  34  0.770500000000000
10  36  0.753600000000000
10  38  0.723200000000000
10  40  0.679800000000000
10  42  0.619700000000000
10  44  0.543800000000000
10  46  0.469100000000000
10  48  0.391100000000000
10  50  0.311500000000000
10  52  0.242100000000000
10  54  0.185000000000000
10  56  0.159900000000000
10  58  0.149200000000000
10  60  0.143300000000000
10  62  0.142200000000000
11  62  0.162200000000000
11  0   0.157500000000000
11  2   0.158500000000000
11  4   0.165400000000000
11  6   0.177100000000000
11  8   0.204800000000000
11  10  0.264300000000000
11  12  0.334400000000000
11  14  0.414500000000000
11  16  0.492600000000000
11  18  0.568500000000000
11  20  0.645200000000000
11  22  0.703700000000000
11  24  0.747000000000000
11  26  0.775600000000000
11  28  0.791400000000000
11  30  0.798400000000000
11  32  0.798400000000000
11  34  0.791400000000000
11  36  0.775600000000000
11  38  0.747000000000000
11  40  0.703700000000000
11  42  0.645200000000000
11  44  0.568500000000000
11  46  0.492600000000000
11  48  0.414500000000000
11  50  0.334400000000000
11  52  0.264300000000000
11  54  0.204800000000000
11  56  0.177100000000000
11  58  0.165400000000000
11  60  0.158500000000000
11  62  0.157500000000000
12  62  0.177500000000000
12  0   0.172100000000000
12  2   0.173400000000000
12  4   0.180700000000000
12  6   0.193300000000000
12  8   0.223900000000000
12  10  0.285200000000000
12  12  0.356200000000000
12  14  0.436300000000000
12  16  0.514200000000000
12  18  0.589700000000000
12  20  0.665900000000000
12  22  0.723600000000000
12  24  0.765800000000000
12  26  0.794200000000000
12  28  0.809600000000000
12  30  0.816500000000000
12  32  0.816500000000000
12  34  0.809600000000000
12  36  0.794200000000000
12  38  0.765800000000000
12  40  0.723600000000000
12  42  0.665900000000000
12  44  0.589700000000000
12  46  0.514200000000000
12  48  0.436300000000000
12  50  0.356200000000000
12  52  0.285200000000000
12  54  0.223900000000000
12  56  0.193300000000000
12  58  0.180700000000000
12  60  0.173400000000000
12  62  0.172100000000000
13  62  0.192100000000000
13  0   0.188800000000000
13  2   0.190000000000000
13  4   0.197600000000000
13  6   0.211800000000000
13  8   0.244800000000000
13  10  0.308100000000000
13  12  0.380700000000000
13  14  0.460900000000000
13  16  0.537000000000000
13  18  0.611600000000000
13  20  0.686300000000000
13  22  0.742400000000000
13  24  0.785300000000000
13  26  0.813100000000000
13  28  0.827700000000000
13  30  0.834200000000000
13  32  0.834200000000000
13  34  0.827700000000000
13  36  0.813100000000000
13  38  0.785300000000000
13  40  0.742400000000000
13  42  0.686300000000000
13  44  0.611600000000000
13  46  0.537000000000000
13  48  0.460900000000000
13  50  0.380700000000000
13  52  0.308100000000000
13  54  0.244800000000000
13  56  0.211800000000000
13  58  0.197600000000000
13  60  0.190000000000000
13  62  0.188800000000000
14  62  0.208800000000000
14  0   0.203800000000000
14  2   0.205300000000000
14  4   0.213700000000000
14  6   0.229000000000000
14  8   0.264100000000000
14  10  0.329300000000000
14  12  0.403200000000000
14  14  0.483400000000000
14  16  0.557500000000000
14  18  0.631300000000000
14  20  0.703900000000000
14  22  0.758200000000000
14  24  0.800300000000000
14  26  0.829100000000000
14  28  0.843200000000000
14  30  0.849100000000000
14  32  0.849100000000000
14  34  0.843200000000000
14  36  0.829100000000000
14  38  0.800300000000000
14  40  0.758200000000000
14  42  0.703900000000000
14  44  0.631300000000000
14  46  0.557500000000000
14  48  0.483400000000000
14  50  0.403200000000000
14  52  0.329300000000000
14  54  0.264100000000000
14  56  0.229000000000000
14  58  0.213700000000000
14  60  0.205300000000000
14  62  0.203800000000000
15  62  0.223800000000000
15  0   0.220600000000000
15  2   0.222200000000000
15  4   0.231000000000000
15  6   0.247800000000000
15  8   0.285600000000000
15  10  0.351900000000000
15  12  0.427000000000000
15  14  0.506800000000000
15  16  0.579400000000000
15  18  0.651800000000000
15  20  0.721700000000000
15  22  0.774000000000000
15  24  0.815800000000000
15  26  0.845100000000000
15  28  0.858800000000000
15  30  0.863900000000000
15  32  0.863900000000000
15  34  0.858800000000000
15  36  0.845100000000000
15  38  0.815800000000000
15  40  0.774000000000000
15  42  0.721700000000000
15  44  0.651800000000000
15  46  0.579400000000000
15  48  0.506800000000000
15  50  0.427000000000000
15  52  0.351900000000000
15  54  0.285600000000000
15  56  0.247800000000000
15  58  0.231000000000000
15  60  0.222200000000000
15  62  0.220600000000000
16  62  0.240600000000000
16  0   0.235700000000000
16  2   0.237700000000000
16  4   0.247400000000000
16  6   0.264900000000000
16  8   0.304900000000000
16  10  0.372900000000000
16  12  0.447500000000000
16  14  0.528100000000000
16  16  0.599400000000000
16  18  0.669100000000000
16  20  0.736900000000000
16  22  0.787800000000000
16  24  0.829100000000000
16  26  0.858100000000000
16  28  0.871800000000000
16  30  0.877400000000000
16  32  0.877400000000000
16  34  0.871800000000000
16  36  0.858100000000000
16  38  0.829100000000000
16  40  0.787800000000000
16  42  0.736900000000000
16  44  0.669100000000000
16  46  0.599400000000000
16  48  0.528100000000000
16  50  0.447500000000000
16  52  0.372900000000000
16  54  0.304900000000000
16  56  0.264900000000000
16  58  0.247400000000000
16  60  0.237700000000000
16  62  0.235700000000000
17  62  0.255700000000000
17  0   0.253700000000000
17  2   0.255900000000000
17  4   0.266500000000000
17  6   0.285300000000000
17  8   0.328100000000000
17  10  0.397200000000000
17  12  0.472300000000000
17  14  0.553200000000000
17  16  0.623300000000000
17  18  0.690000000000000
17  20  0.754500000000000
17  22  0.803100000000000
17  24  0.843200000000000
17  26  0.872700000000000
17  28  0.886400000000000
17  30  0.891600000000000
17  32  0.891600000000000
17  34  0.886400000000000
17  36  0.872700000000000
17  38  0.843200000000000
17  40  0.803100000000000
17  42  0.754500000000000
17  44  0.690000000000000
17  46  0.623300000000000
17  48  0.553200000000000
17  50  0.472300000000000
17  52  0.397200000000000
17  54  0.328100000000000
17  56  0.285300000000000
17  58  0.266500000000000
17  60  0.255900000000000
17  62  0.253700000000000
18  62  0.273700000000000
18  0   0.272700000000000
18  2   0.275100000000000
18  4   0.285900000000000
18  6   0.307000000000000
18  8   0.351300000000000
18  10  0.422700000000000
18  12  0.497400000000000
18  14  0.578400000000000
18  16  0.648400000000000
18  18  0.709000000000000
18  20  0.771700000000000
18  22  0.818000000000000
18  24  0.857200000000000
18  26  0.886100000000000
18  28  0.899500000000000
18  30  0.905200000000000
18  32  0.905200000000000
18  34  0.899500000000000
18  36  0.886100000000000
18  38  0.857200000000000
18  40  0.818000000000000
18  42  0.771700000000000
18  44  0.709000000000000
18  46  0.648400000000000
18  48  0.578400000000000
18  50  0.497400000000000
18  52  0.422700000000000
18  54  0.351300000000000
18  56  0.307000000000000

相关内容