我该如何去除那些不需要的蜱虫,比如我在图片中用蓝色标记的蜱虫?
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{filecontents}{data.txt}
1 24.4204 1.1
2 25.7634 1.2
3 23.3449 1.3
4 22.5645 1.4
5 23.7131 2.1
6 22.3359 2.2
7 23.375 2.3
8 23.6178 2.4
9 21.8432 3.1
10 21.9447 3.2
11 24.7864 3.3
12 24.7976 3.4
13 21.7972 4.1
14 19.6314 4.2
15 19.7086 4.3
16 21.587 4.4
17 20.321 5.1
18 19.7204 5.2
19 21.3112 5.3
20 18.5815 5.4
21 24.3056 6.1
22 23.9119 6.2
23 22.1149 6.3
24 20.6203 6.4
25 19.2386 7.1
26 19.6875 7.2
27 15.75 7.3
28 20.766 7.4
29 20.1868 8.1
30 20.9071 8.2
31 16.7384 8.3
32 21.9214 8.4
33 22.9943 9.1
34 23.3581 9.2
35 22.0794 9.3
36 19.2073 9.4
37 20.7601 10.1
38 22.6293 10.2
39 22.0794 10.3
40 21.7541 10.4
41 21.8346 11.1
42 23.1488 11.2
43 22.9688 11.3
44 18.1891 11.4
45 23.2923 12.1
46 27.3528 12.2
47 27.9917 12.3
48 27.3754 12.4
49 27.5993 13.1
50 26.9648 13.2
51 25.9087 13.3
52 20.9627 13.4
53 17.7823 14.1
54 21.7656 14.2
55 19.3331 14.3
56 20.5793 14.4
57 22.1001 15.1
58 22.2667 15.2
59 21.7541 15.3
60 17.9249 15.4
61 17.7632 16.1
62 20.8333 16.2
63 18.4933 16.3
64 18.9888 16.4
65 18.3944 17.1
66 22.3722 17.2
67 20.1579 17.3
68 15.8984 17.4
69 22.2877 18.1
70 25.4607 18.2
71 25.346 18.3
72 24.4565 18.4
73 24.1071 19.1
74 22.4116 19.2
75 21.8949 19.3
76 22.1449 19.4
77 21.999 20.1
78 22.9349 20.2
79 21.7142 20.3
80 23.3449 20.4
81 23.253 21.1
82 19.1451 21.2
83 17.1854 21.3
84 16.2787 21.4
85 21.1315 22.1
86 23.7676 22.2
87 21.5557 22.3
88 23.7199 22.4
89 22.586 23.1
90 20.9548 23.2
91 19.0612 23.3
92 19.081 23.4
93 23.2008 24.1
94 22.2051 24.2
95 20.5809 24.3
96 23.3581 24.4
97 23.843 25.1
98 25.6793 25.2
99 20.3764 25.3
100 23.7063 25.4
101 26.9165 26.1
102 28.9117 26.2
103 25.3643 26.3
104 24.6094 26.4
105 30.7617 27.1
106 26.2237 27.2
107 21.1865 27.3
108 16.9442 27.4
109 20.1677 28.1
110 18.913 28.2
111 19.9535 28.3
112 20.7967 28.4
113 22.7163 29.1
114 19.2835 29.2
115 12.8397 29.3
116 20.5486 29.4
117 21.6686 30.1
118 16.0574 30.2
119 18.7479 30.3
120 21.3552 30.4
121 23.4325 31.1
122 23.2317 31.2
123 16.8612 31.3
124 15.7801 31.4
125 18.965 32.1
126 19.6875 32.2
127 21.0938 32.3
128 20.9873 32.4
129 21.1822 33.1
130 20.9488 33.2
131 20.7842 33.3
132 14.5474 33.4
133 9.92528 34.1
134 14.8719 34.2
135 19.2476 34.3
136 16.1247 34.4
137 16.1641 35.1
138 18.0481 35.2
139 16.1531 35.3
140 11.9491 35.4
\end{filecontents}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
height=5cm,
minor x tick num=1,
minor y tick num=4,
xlabel={Taktzahl},
ylabel={Tempo~in~bpm},
ymin=0, ymax=150,
ymin=0, ymax=140,
]
\addplot[black] table{data.txt};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
答案1
\begin{filecontents}{data.txt}
1 24.4204 1.1
2 25.7634 1.2
3 23.3449 1.3
4 22.5645 1.4
137 16.1641 35.1
138 18.0481 35.2
139 16.1531 35.3
140 11.9491 35.4
\end{filecontents}
\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
height=5cm,
minor x tick num=1,
minor y tick num=4,
xlabel={Taktzahl},
ylabel={Tempo~in~bpm},
ymin=0, ymax=150,
xmin=0, xmax=140,
enlarge x limits={abs=15},
xtick={0,20,...,140}
]
\addplot[black] table{data.txt};
\end{axis}
\end{tikzpicture}
\end{document}
答案2
我确信我会将您的问题描述为无意的拼写错误。如果您两次指定ymin
and ymax
,则应该使用xmin
andxmax
作为其中一项规范。
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{filecontents}{data.txt}
1 24.4204 1.1
2 25.7634 1.2
3 23.3449 1.3
4 22.5645 1.4
5 23.7131 2.1
6 22.3359 2.2
7 23.375 2.3
8 23.6178 2.4
9 21.8432 3.1
10 21.9447 3.2
11 24.7864 3.3
12 24.7976 3.4
13 21.7972 4.1
14 19.6314 4.2
15 19.7086 4.3
16 21.587 4.4
17 20.321 5.1
18 19.7204 5.2
19 21.3112 5.3
20 18.5815 5.4
21 24.3056 6.1
22 23.9119 6.2
23 22.1149 6.3
24 20.6203 6.4
25 19.2386 7.1
26 19.6875 7.2
27 15.75 7.3
28 20.766 7.4
29 20.1868 8.1
30 20.9071 8.2
31 16.7384 8.3
32 21.9214 8.4
33 22.9943 9.1
34 23.3581 9.2
35 22.0794 9.3
36 19.2073 9.4
37 20.7601 10.1
38 22.6293 10.2
39 22.0794 10.3
40 21.7541 10.4
41 21.8346 11.1
42 23.1488 11.2
43 22.9688 11.3
44 18.1891 11.4
45 23.2923 12.1
46 27.3528 12.2
47 27.9917 12.3
48 27.3754 12.4
49 27.5993 13.1
50 26.9648 13.2
51 25.9087 13.3
52 20.9627 13.4
53 17.7823 14.1
54 21.7656 14.2
55 19.3331 14.3
56 20.5793 14.4
57 22.1001 15.1
58 22.2667 15.2
59 21.7541 15.3
60 17.9249 15.4
61 17.7632 16.1
62 20.8333 16.2
63 18.4933 16.3
64 18.9888 16.4
65 18.3944 17.1
66 22.3722 17.2
67 20.1579 17.3
68 15.8984 17.4
69 22.2877 18.1
70 25.4607 18.2
71 25.346 18.3
72 24.4565 18.4
73 24.1071 19.1
74 22.4116 19.2
75 21.8949 19.3
76 22.1449 19.4
77 21.999 20.1
78 22.9349 20.2
79 21.7142 20.3
80 23.3449 20.4
81 23.253 21.1
82 19.1451 21.2
83 17.1854 21.3
84 16.2787 21.4
85 21.1315 22.1
86 23.7676 22.2
87 21.5557 22.3
88 23.7199 22.4
89 22.586 23.1
90 20.9548 23.2
91 19.0612 23.3
92 19.081 23.4
93 23.2008 24.1
94 22.2051 24.2
95 20.5809 24.3
96 23.3581 24.4
97 23.843 25.1
98 25.6793 25.2
99 20.3764 25.3
100 23.7063 25.4
101 26.9165 26.1
102 28.9117 26.2
103 25.3643 26.3
104 24.6094 26.4
105 30.7617 27.1
106 26.2237 27.2
107 21.1865 27.3
108 16.9442 27.4
109 20.1677 28.1
110 18.913 28.2
111 19.9535 28.3
112 20.7967 28.4
113 22.7163 29.1
114 19.2835 29.2
115 12.8397 29.3
116 20.5486 29.4
117 21.6686 30.1
118 16.0574 30.2
119 18.7479 30.3
120 21.3552 30.4
121 23.4325 31.1
122 23.2317 31.2
123 16.8612 31.3
124 15.7801 31.4
125 18.965 32.1
126 19.6875 32.2
127 21.0938 32.3
128 20.9873 32.4
129 21.1822 33.1
130 20.9488 33.2
131 20.7842 33.3
132 14.5474 33.4
133 9.92528 34.1
134 14.8719 34.2
135 19.2476 34.3
136 16.1247 34.4
137 16.1641 35.1
138 18.0481 35.2
139 16.1531 35.3
140 11.9491 35.4
\end{filecontents}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
height=5cm,
minor x tick num=1,
minor y tick num=4,
xlabel={Taktzahl},
ylabel={Tempo~in~bpm},
xmin=0, xmax=140,
ymin=0, %ymax=140,
]
\addplot[black] table{data.txt};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}