无法移动图例 TikZ - PGFPlots

无法移动图例 TikZ - PGFPlots

我一直试图将图例从图中移开,以便看得更清楚,但无济于事。有人能帮我吗?请查看附加的代码,由于字符限制,我不得不缩小它,但实际上我有 4 个图...

\documentclass[tikz,border=2pt,png]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7} % Set the pgf plots to a current version
\usepackage{amsmath}
\RequirePackage{fontspec}
    \defaultfontfeatures{Ligatures=TeX}
    \setsansfont{Tex Gyre Heros}
    \setmainfont[Numbers=OldStyle]{TeX Gyre Pagella}
    \setmonofont[Scale=0.85]{DejaVu Sans Mono} 
\usepackage[]{tikz}
\usepgfplotslibrary{units}

\definecolor{mycolor1}{rgb}{0.5608, 0.0275, 0}%
\definecolor{mycolor2}{rgb}{0.9490, 0.0706, 0.0078}%
\definecolor{mycolor3}{rgb}{0.9922, 0.4078, 0.3647}%
\definecolor{mycolor4}{rgb}{0.9961, 0.5569, 0.5255}%
\definecolor{mycolor5}{rgb}{ 0.9961, 0.7059, 0.6824}%
\definecolor{mycolor6}{rgb}{1.0000, 0.9255, 0.9216}%

\begin{document}

\begin{tikzpicture}

\begin{axis}[%
width=4.667in,
height=3.5in,
at={(0.583in,0.438in)},
scale only axis,
xmin=200,
xmax=250,
xlabel style={font=\color{white!15!black}},
xlabel={Time [ms]},
ymin=-2.5,
ymax=2.5,
ylabel style={font=\color{white!15!black}},
ylabel={Current [A]},
axis background/.style={fill=white},
xminorgrids,
yminorgrids,
legend style={legend cell align=left, at={(0.8,0.1)}, anchor=south, draw=white!15!black}
]
\addplot [color=mycolor1, line width=1.5pt]
  table[row sep=crcr]{%
1   0.172017364596249\\
2   -0.410415765413538\\
3   -0.395361119896053\\
4   -0.568048830590801\\
5   -0.386982502072344\\
6   -1.04863757521585\\
7   -1.10671880342013\\
8   -0.826575524089087\\
9   -1.26489363975045\\
10  -1.22309778527639\\
11  -1.48862124090448\\
12  -1.37059251431378\\
13  -1.15387647091651\\
14  -1.66073729176096\\
15  -1.79424692025926\\
16  -1.15826003166197\\
17  -1.40158220315728\\
18  -0.937006211525737\\
19  -0.98200772947152\\
20  -0.965683302712306\\
21  -0.695840651612521\\
22  -0.832882416207692\\
23  -0.256380009756434\\
24  -0.444470295613566\\
25  -0.341428475204689\\
26  -0.172017364596254\\
27  0.410415765413534\\
28  0.395361119896046\\
29  0.568048830590801\\
30  0.386982502072345\\
31  1.04863757521586\\
32  1.10671880342013\\
33  0.82657552408909\\
34  1.26489363975045\\
35  1.2230977852764\\
36  1.48862124090448\\
37  1.37059251431377\\
38  1.15387647091651\\
39  1.66073729176097\\
40  1.79424692025926\\
41  1.15826003166197\\
42  1.40158220315728\\
43  0.937006211525737\\
44  0.982007729471518\\
45  0.965683302712302\\
46  0.695840651612518\\
47  0.832882416207692\\
48  0.25638000975643\\
49  0.444470295613567\\
50  0.341428475204694\\
51  0.172017364596244\\
52  -0.410415765413546\\
53  -0.395361119896045\\
54  -0.568048830590799\\
55  -0.386982502072344\\
56  -1.04863757521584\\
57  -1.10671880342013\\
58  -0.826575524089083\\
59  -1.26489363975045\\
60  -1.22309778527639\\
61  -1.48862124090449\\
62  -1.37059251431376\\
63  -1.15387647091651\\
64  -1.66073729176097\\
65  -1.79424692025927\\
66  -1.15826003166198\\
67  -1.40158220315728\\
68  -0.937006211525734\\
69  -0.98200772947153\\
70  -0.965683302712299\\
71  -0.69584065161251\\
72  -0.832882416207686\\
73  -0.256380009756436\\
74  -0.444470295613568\\
75  -0.341428475204684\\
76  -0.172017364596248\\
77  0.410415765413534\\
78  0.395361119896057\\
79  0.568048830590802\\
80  0.386982502072346\\
81  1.04863757521585\\
82  1.10671880342015\\
83  0.826575524089081\\
84  1.26489363975045\\
85  1.22309778527639\\
86  1.48862124090449\\
87  1.37059251431378\\
88  1.15387647091651\\
89  1.66073729176096\\
90  1.79424692025926\\
91  1.15826003166197\\
92  1.40158220315727\\
93  0.937006211525749\\
94  0.982007729471529\\
95  0.96568330271231\\
96  0.695840651612509\\
97  0.832882416207702\\
98  0.256380009756443\\
99  0.444470295613576\\
100 0.341428475204691\\
101 0.172017364596257\\
102 -0.410415765413546\\
103 -0.395361119896061\\
104 -0.568048830590799\\
105 -0.386982502072348\\
106 -1.04863757521585\\
107 -1.10671880342014\\
108 -0.826575524089088\\
109 -1.26489363975046\\
110 -1.2230977852764\\
111 -1.48862124090449\\
112 -1.37059251431377\\
113 -1.15387647091651\\
114 -1.66073729176096\\
115 -1.79424692025928\\
116 -1.15826003166198\\
117 -1.40158220315727\\
118 -0.937006211525752\\
119 -0.982007729471519\\
120 -0.965683302712298\\
121 -0.695840651612504\\
122 -0.832882416207683\\
123 -0.256380009756433\\
124 -0.444470295613559\\
125 -0.341428475204682\\
126 -0.172017364596239\\
127 0.410415765413531\\
128 0.395361119896046\\
129 0.568048830590804\\
130 0.386982502072338\\
131 1.04863757521587\\
132 1.10671880342013\\
133 0.826575524089072\\
134 1.26489363975045\\
135 1.2230977852764\\
136 1.48862124090448\\
137 1.37059251431377\\
138 1.15387647091651\\
139 1.66073729176096\\
140 1.79424692025926\\
141 1.15826003166199\\
142 1.40158220315728\\
143 0.937006211525738\\
144 0.982007729471519\\
145 0.965683302712301\\
146 0.695840651612513\\
147 0.832882416207696\\
148 0.256380009756431\\
149 0.444470295613575\\
150 0.341428475204679\\
151 0.172017364596243\\
152 -0.410415765413543\\
153 -0.395361119896052\\
154 -0.568048830590803\\
155 -0.386982502072335\\
156 -1.04863757521585\\
157 -1.10671880342014\\
158 -0.826575524089092\\
159 -1.26489363975046\\
160 -1.22309778527638\\
161 -1.48862124090448\\
162 -1.37059251431379\\
163 -1.1538764709165\\
164 -1.66073729176097\\
165 -1.79424692025925\\
166 -1.15826003166198\\
167 -1.40158220315728\\
168 -0.937006211525748\\
169 -0.982007729471523\\
170 -0.965683302712278\\
171 -0.695840651612529\\
172 -0.832882416207682\\
173 -0.256380009756438\\
174 -0.444470295613564\\
175 -0.341428475204684\\
176 -0.172017364596233\\
177 0.41041576541353\\
178 0.395361119896062\\
179 0.568048830590799\\
180 0.386982502072347\\
181 1.04863757521587\\
182 1.10671880342013\\
183 0.82657552408909\\
184 1.26489363975044\\
185 1.22309778527639\\
186 1.48862124090449\\
187 1.37059251431377\\
188 1.15387647091651\\
189 1.66073729176095\\
190 1.79424692025927\\
191 1.15826003166199\\
192 1.40158220315728\\
193 0.937006211525747\\
194 0.982007729471522\\
195 0.965683302712311\\
196 0.695840651612511\\
197 0.832882416207705\\
198 0.256380009756432\\
199 0.444470295613566\\
200 0.341428475204688\\
201 0.172017364596258\\
202 -0.410415765413525\\
203 -0.395361119896074\\
204 -0.568048830590786\\
205 -0.386982502072352\\
206 -1.04863757521584\\
207 -1.10671880342015\\
208 -0.826575524089075\\
209 -1.26489363975045\\
210 -1.2230977852764\\
211 -1.48862124090448\\
212 -1.37059251431377\\
213 -1.15387647091651\\
214 -1.66073729176096\\
215 -1.79424692025926\\
216 -1.15826003166197\\
217 -1.40158220315728\\
218 -0.937006211525751\\
219 -0.98200772947152\\
220 -0.965683302712322\\
221 -0.69584065161252\\
222 -0.832882416207682\\
223 -0.256380009756432\\
224 -0.444470295613568\\
225 -0.341428475204689\\
226 -0.172017364596244\\
227 0.410415765413548\\
228 0.395361119896074\\
229 0.568048830590786\\
230 0.386982502072355\\
231 1.04863757521586\\
232 1.10671880342014\\
233 0.82657552408907\\
234 1.26489363975045\\
235 1.22309778527639\\
236 1.48862124090449\\
237 1.37059251431378\\
238 1.15387647091651\\
239 1.66073729176098\\
240 1.79424692025927\\
241 1.15826003166197\\
242 1.40158220315729\\
243 0.937006211525712\\
244 0.98200772947154\\
245 0.965683302712297\\
246 0.69584065161252\\
247 0.832882416207684\\
248 0.256380009756437\\
249 0.444470295613564\\
250 0.341428475204697\\
251 0.172017364596229\\
252 -0.41041576541353\\
253 -0.395361119896068\\
254 -0.568048830590784\\
255 -0.38698250207235\\
256 -1.04863757521585\\
257 -1.10671880342015\\
258 -0.826575524089097\\
259 -1.26489363975047\\
260 -1.22309778527638\\
261 -1.48862124090451\\
262 -1.37059251431375\\
263 -1.15387647091652\\
264 -1.66073729176096\\
265 -1.79424692025926\\
266 -1.15826003166197\\
267 -1.4015822031573\\
268 -0.93700621152574\\
269 -0.982007729471516\\
270 -0.96568330271227\\
271 -0.695840651612533\\
272 -0.832882416207658\\
273 -0.256380009756437\\
274 -0.444470295613555\\
275 -0.341428475204701\\
276 -0.172017364596227\\
277 0.41041576541352\\
278 0.395361119896059\\
279 0.568048830590812\\
280 0.386982502072339\\
281 1.04863757521587\\
282 1.10671880342013\\
283 0.826575524089074\\
284 1.26489363975047\\
285 1.2230977852764\\
286 1.48862124090448\\
287 1.37059251431374\\
288 1.15387647091654\\
289 1.66073729176095\\
290 1.79424692025927\\
291 1.15826003166197\\
292 1.4015822031573\\
293 0.937006211525729\\
294 0.98200772947154\\
295 0.965683302712246\\
296 0.695840651612533\\
297 0.832882416207706\\
298 0.256380009756423\\
299 0.444470295613554\\
300 0.341428475204684\\
301 0.172017364596203\\
302 -0.410415765413513\\
303 -0.395361119896098\\
304 -0.568048830590805\\
305 -0.386982502072331\\
306 -1.04863757521584\\
307 -1.10671880342011\\
308 -0.826575524089101\\
309 -1.26489363975046\\
310 -1.22309778527636\\
311 -1.48862124090452\\
312 -1.37059251431376\\
313 -1.15387647091651\\
314 -1.66073729176094\\
315 -1.79424692025923\\
316 -1.15826003166198\\
317 -1.40158220315729\\
318 -0.93700621152572\\
319 -0.982007729471541\\
320 -0.965683302712258\\
321 -0.695840651612555\\
322 -0.832882416207628\\
323 -0.25638000975642\\
324 -0.444470295613554\\
325 -0.341428475204679\\
326 -0.1720173645962\\
327 0.410415765413505\\
328 0.395361119896077\\
329 0.568048830590816\\
330 0.386982502072333\\
331 1.04863757521592\\
332 1.10671880342011\\
333 0.826575524089107\\
334 1.26489363975045\\
335 1.22309778527638\\
336 1.48862124090455\\
337 1.37059251431377\\
338 1.15387647091653\\
339 1.66073729176096\\
340 1.79424692025926\\
341 1.15826003166198\\
342 1.40158220315732\\
343 0.937006211525726\\
344 0.982007729471585\\
345 0.965683302712254\\
346 0.695840651612545\\
347 0.832882416207658\\
348 0.256380009756448\\
349 0.444470295613566\\
350 0.341428475204689\\
351 0.172017364596214\\
352 -0.410415765413533\\
353 -0.395361119896093\\
354 -0.568048830590807\\
355 -0.38698250207233\\
356 -1.0486375752159\\
357 -1.10671880342012\\
358 -0.826575524089109\\
359 -1.26489363975045\\
360 -1.2230977852764\\
361 -1.48862124090452\\
362 -1.37059251431374\\
363 -1.1538764709165\\
364 -1.66073729176099\\
365 -1.79424692025923\\
366 -1.15826003166198\\
367 -1.40158220315731\\
368 -0.937006211525733\\
369 -0.982007729471601\\
370 -0.965683302712223\\
371 -0.695840651612562\\
372 -0.832882416207652\\
373 -0.256380009756458\\
374 -0.444470295613569\\
375 -0.341428475204667\\
376 -0.172017364596225\\
377 0.410415765413538\\
378 0.395361119896073\\
379 0.568048830590805\\
380 0.386982502072337\\
381 1.0486375752159\\
382 1.10671880342009\\
383 0.826575524089105\\
384 1.26489363975045\\
385 1.22309778527635\\
386 1.48862124090449\\
387 1.37059251431377\\
388 1.1538764709165\\
389 1.66073729176099\\
390 1.79424692025928\\
391 1.15826003166196\\
392 1.40158220315728\\
393 0.937006211525721\\
394 0.982007729471604\\
395 0.965683302712261\\
396 0.695840651612536\\
397 0.832882416207712\\
398 0.256380009756456\\
399 0.444470295613549\\
400 0.341428475204705\\
401 0.172017364596225\\
402 -0.410415765413519\\
403 -0.395361119896081\\
404 -0.568048830590814\\
405 -0.386982502072336\\
406 -1.04863757521593\\
407 -1.1067188034201\\
408 -0.826575524089118\\
409 -1.26489363975045\\
410 -1.22309778527636\\
411 -1.48862124090447\\
412 -1.37059251431375\\
413 -1.15387647091651\\
414 -1.66073729176098\\
415 -1.79424692025923\\
416 -1.15826003166197\\
417 -1.40158220315728\\
418 -0.937006211525658\\
419 -0.982007729471571\\
420 -0.96568330271223\\
421 -0.695840651612533\\
422 -0.83288241620767\\
423 -0.256380009756434\\
424 -0.444470295613558\\
425 -0.341428475204677\\
426 -0.172017364596248\\
427 0.410415765413528\\
428 0.395361119896089\\
429 0.568048830590805\\
430 0.386982502072336\\
431 1.04863757521584\\
432 1.1067188034201\\
433 0.826575524089123\\
434 1.26489363975046\\
435 1.22309778527638\\
436 1.48862124090448\\
437 1.37059251431375\\
438 1.15387647091651\\
439 1.66073729176097\\
440 1.79424692025923\\
441 1.15826003166198\\
442 1.40158220315728\\
443 0.937006211525647\\
444 0.982007729471541\\
445 0.965683302712234\\
446 0.695840651612525\\
447 0.83288241620763\\
448 0.256380009756411\\
449 0.444470295613537\\
450 0.341428475204697\\
451 0.172017364596228\\
452 -0.410415765413551\\
453 -0.39536111989607\\
454 -0.568048830590802\\
455 -0.386982502072323\\
456 -1.0486375752159\\
457 -1.10671880342011\\
458 -0.826575524089106\\
459 -1.26489363975047\\
460 -1.22309778527636\\
461 -1.48862124090455\\
462 -1.37059251431376\\
463 -1.15387647091653\\
464 -1.66073729176096\\
465 -1.79424692025925\\
466 -1.15826003166201\\
467 -1.40158220315731\\
468 -0.937006211525724\\
469 -0.982007729471611\\
470 -0.965683302712297\\
471 -0.695840651612549\\
472 -0.832882416207643\\
473 -0.256380009756427\\
474 -0.444470295613575\\
475 -0.341428475204701\\
476 -0.172017364596223\\
477 0.410415765413526\\
478 0.395361119896061\\
479 0.568048830590788\\
480 0.38698250207234\\
481 1.0486375752159\\
482 1.10671880342013\\
483 0.8265755240891\\
484 1.26489363975047\\
485 1.22309778527637\\
486 1.48862124090452\\
487 1.37059251431378\\
488 1.15387647091653\\
489 1.66073729176102\\
490 1.79424692025924\\
491 1.15826003166198\\
492 1.40158220315731\\
493 0.937006211525714\\
494 0.982007729471585\\
495 0.965683302712287\\
496 0.695840651612557\\
497 0.832882416207687\\
498 0.256380009756458\\
499 0.444470295613588\\
500 0.3414284752047\\
};
\addlegendentry{I mea1}

\addplot [color=mycolor2, line width=1.5pt]
  table[row sep=crcr]{%
1   0.170002074424028\\
2   -0.496997377014286\\
3   -0.60232763343571\\
4   -0.228904082913221\\
5   -0.320270625860072\\
6   -1.15668945423026\\
7   -1.1305907548919\\
8   -0.876712623344846\\
9   -1.23894284364455\\
10  -1.28987740565162\\
11  -1.59098133337759\\
12  -1.40610133832757\\
13  -0.828740459324251\\
14  -1.72060209014135\\
15  -1.93478961570316\\
16  -1.12737723040381\\
17  -1.30053627493649\\
18  -1.08044755704358\\
19  -0.874184666435182\\
20  -1.017150077801\\
21  -0.940959212624474\\
22  -0.681016157790239\\
23  -0.272119561399761\\
24  -0.428197665175396\\
25  -0.337219635396122\\
26  -0.170002074424036\\
27  0.496997377014284\\
28  0.602327633435704\\
29  0.22890408291322\\
30  0.320270625860079\\
31  1.15668945423027\\
32  1.1305907548919\\
33  0.876712623344852\\
34  1.23894284364454\\
35  1.28987740565163\\
36  1.59098133337759\\
37  1.40610133832757\\
38  0.828740459324245\\
39  1.72060209014135\\
40  1.93478961570317\\
41  1.12737723040381\\
42  1.3005362749365\\
43  1.08044755704358\\
44  0.874184666435177\\
45  1.017150077801\\
46  0.940959212624467\\
47  0.681016157790238\\
48  0.272119561399758\\
49  0.428197665175397\\
50  0.337219635396127\\
51  0.170002074424026\\
52  -0.496997377014295\\
53  -0.602327633435699\\
54  -0.228904082913217\\
55  -0.320270625860076\\
56  -1.15668945423026\\
57  -1.13059075489189\\
58  -0.876712623344848\\
59  -1.23894284364454\\
60  -1.28987740565162\\
61  -1.59098133337761\\
62  -1.40610133832755\\
63  -0.828740459324241\\
64  -1.72060209014136\\
65  -1.93478961570317\\
66  -1.12737723040381\\
67  -1.30053627493649\\
68  -1.08044755704357\\
69  -0.874184666435192\\
70  -1.01715007780099\\
71  -0.940959212624463\\
72  -0.681016157790233\\
73  -0.272119561399771\\
74  -0.428197665175402\\
75  -0.337219635396116\\
76  -0.170002074424028\\
77  0.496997377014278\\
78  0.602327633435712\\
79  0.228904082913223\\
80  0.320270625860074\\
81  1.15668945423026\\
82  1.1305907548919\\
83  0.876712623344837\\
84  1.23894284364454\\
85  1.28987740565162\\
86  1.5909813333776\\
87  1.40610133832757\\
88  0.828740459324241\\
89  1.72060209014135\\
90  1.93478961570317\\
91  1.12737723040381\\
92  1.30053627493648\\
93  1.08044755704359\\
94  0.874184666435194\\
95  1.017150077801\\
96  0.940959212624472\\
97  0.681016157790247\\
98  0.272119561399771\\
99  0.428197665175407\\
100 0.337219635396124\\
101 0.170002074424036\\
102 -0.496997377014295\\
103 -0.602327633435717\\
104 -0.228904082913222\\
105 -0.320270625860076\\
106 -1.15668945423026\\
107 -1.13059075489191\\
108 -0.876712623344849\\
109 -1.23894284364455\\
110 -1.28987740565162\\
111 -1.5909813333776\\
112 -1.40610133832757\\
113 -0.828740459324245\\
114 -1.72060209014134\\
115 -1.93478961570318\\
116 -1.12737723040382\\
117 -1.30053627493648\\
118 -1.08044755704359\\
119 -0.874184666435192\\
120 -1.01715007780099\\
121 -0.940959212624454\\
122 -0.681016157790229\\
123 -0.272119561399758\\
124 -0.428197665175398\\
125 -0.33721963539611\\
126 -0.170002074424016\\
127 0.496997377014277\\
128 0.602327633435702\\
129 0.228904082913229\\
130 0.320270625860061\\
131 1.15668945423028\\
132 1.13059075489189\\
133 0.876712623344835\\
134 1.23894284364454\\
135 1.28987740565162\\
136 1.59098133337759\\
137 1.40610133832757\\
138 0.828740459324239\\
139 1.72060209014134\\
140 1.93478961570317\\
141 1.12737723040383\\
142 1.30053627493649\\
143 1.08044755704359\\
144 0.874184666435176\\
145 1.01715007780099\\
146 0.940959212624465\\
147 0.681016157790247\\
148 0.272119561399755\\
149 0.428197665175405\\
150 0.337219635396108\\
151 0.170002074424023\\
152 -0.496997377014288\\
153 -0.602327633435715\\
154 -0.228904082913223\\
155 -0.32027062586006\\
156 -1.15668945423026\\
157 -1.13059075489191\\
158 -0.876712623344856\\
159 -1.23894284364455\\
160 -1.28987740565161\\
161 -1.59098133337759\\
162 -1.4061013383276\\
163 -0.828740459324236\\
164 -1.72060209014137\\
165 -1.93478961570316\\
166 -1.12737723040382\\
332 1.1305907548919\\
333 0.87671262334485\\
334 1.23894284364456\\
335 1.2898774056516\\
336 1.59098133337766\\
337 1.40610133832757\\
338 0.828740459324261\\
339 1.72060209014134\\
340 1.93478961570316\\
341 1.12737723040382\\
342 1.30053627493653\\
343 1.08044755704358\\
344 0.874184666435227\\
345 1.01715007780096\\
346 0.940959212624471\\
347 0.681016157790221\\
348 0.272119561399774\\
349 0.428197665175396\\
350 0.337219635396118\\
351 0.170002074424006\\
352 -0.496997377014284\\
353 -0.602327633435755\\
354 -0.228904082913215\\
355 -0.320270625860075\\
356 
498 0.272119561399792\\
499 0.428197665175413\\
500 0.337219635396129\\
};
\addlegendentry{I mea2}

\addplot [color=mycolor3, line width=1.5pt]
  table[row sep=crcr]{%
1   0.294648833402032\\
2   -0.540286222350579\\
3   -0.322802260755896\\
4   -0.568053215783501\\
5   -0.37745239671037\\
6   -1.18251417204953\\
7   -0.903329567833859\\
8   -0.975975108026737\\
9   -1.38304198808751\\
10  -0.895696002067393\\
11  -1.5945889011014\\
12  -1.33867312909549\\
13  -1.18050337045592\\
14  -1.5164933539612\\
15  -2.07599105540902\\
16  -1.01173182390569\\
17  -1.46259791568669\\
18  -1.06300141740081\\
19  -0.703480576621047\\
20  -0.940586686092421\\
21  -0.766970293728375\\
22  -0.76009249713246\\
23  -0.316360021706978\\
24  -0.738823723740521\\
25  -0.044007201318402\\
26  -0.294648833402038\\
27  0.54028622235058\\
28  0.322802260755887\\
29  0.568053215783504\\
30  0.377452396710372\\
368 -1.06300141740081\\
369 -0.703480576621166\\
370 -0.940586686092314\\
371 -0.766970293728447\\
372 -0.760092497132386\\
373 -0.316360021707047\\
374 -0.738823723740487\\
375 -0.0440072013184055\\
376 -0.294648833402006\\
377 0.540286222350586\\
378 0.322802260755911\\
379 0.568053215783527\\
380 0.377452396710364\\
381 1.18251417204959\\
382 0.903329567833794\\
383 0.975975108026782\\
384 1.38304198808748\\
385 0.895696002067397\\
386 1.59458890110139\\
387 1.33867312909548\\
388 1.18050337045592\\
389 1.51649335396121\\
390 2.07599105540905\\
391 1.01173182390563\\
392 1.46259791568668\\
393 1.06300141740077\\
394 0.703480576621181\\
395 0.940586686092356\\
396 0.766970293728403\\
397 0.760092497132463\\
398 0.316360021707012\\
399 0.738823723740458\\
400 0.0440072013184335\\
401 0.294648833402004\\
402 -0.540286222350548\\
403 -0.322802260755912\\
404 -0.568053215783538\\
405 -0.377452396710362\\
406 -1.18251417204962\\
407 -0.903329567833813\\
408 -0.97597510802681\\
409 -1.38304198808748\\
410 -0.895696002067393\\
411 -1.59458890110138\\
412 -1.33867312909547\\
413 -1.18050337045592\\
414 -1.51649335396121\\
415 -2.07599105540902\\
416 -1.01173182390566\\
417 -1.4625979156867\\
418 -1.06300141740068\\
419 -0.703480576621133\\
420 -0.940586686092326\\
421 -0.76697029372838\\
422 -0.76009249713241\\
423 -0.316360021707021\\
424 -0.738823723740496\\
425 -0.0440072013184159\\
426 -0.294648833402025\\
427 0.540286222350583\\
428 0.322802260755911\\
429 0.568053215783511\\
430 0.377452396710362\\
431 1.18251417204953\\
432 0.903329567833805\\
433 0.97597510802683\\
434 1.38304198808751\\
435 0.895696002067413\\
436 1.59458890110141\\
437 1.33867312909546\\
438 1.18050337045591\\
439 1.51649335396118\\
440 2.07599105540903\\
441 1.01173182390565\\
442 1.46259791568672\\
443 1.06300141740063\\
444 0.703480576621088\\
445 0.940586686092349\\
446 0.766970293728364\\
447 0.760092497132361\\
448 0.316360021706983\\
449 0.738823723740451\\
450 0.0440072013184318\\
451 0.294648833402034\\
452 -0.540286222350601\\
453 -0.322802260755892\\
454 -0.568053215783483\\
455 -0.377452396710346\\
456 -1.18251417204955\\
457 -0.903329567833805\\
458 -0.975975108026739\\
459 -1.38304198808748\\
460 -0.895696002067356\\
461 -1.5945889011015\\
462 -1.33867312909547\\
463 -1.18050337045592\\
464 -1.51649335396123\\
465 -2.07599105540903\\
466 -1.0117318239057\\
467 -1.46259791568679\\
468 -1.0630014174008\\
469 -0.703480576621141\\
470 -0.940586686092425\\
471 -0.766970293728411\\
472 -0.760092497132342\\
473 -0.316360021707\\
474 -0.738823723740443\\
475 -0.0440072013184279\\
476 -0.294648833402015\\
477 0.54028622235061\\
478 0.32280226075589\\
479 0.568053215783465\\
480 0.377452396710376\\
481 1.18251417204956\\
482 0.903329567833837\\
483 0.975975108026771\\
484 1.38304198808748\\
485 0.895696002067365\\
486 1.59458890110147\\
487 1.33867312909547\\
488 1.18050337045594\\
489 1.51649335396125\\
490 2.07599105540902\\
491 1.01173182390566\\
492 1.46259791568677\\
493 1.06300141740076\\
494 0.703480576621115\\
495 0.940586686092392\\
496 0.766970293728418\\
497 0.760092497132459\\
498 0.316360021707057\\
499 0.738823723740513\\
500 0.0440072013184259\\
};
\addlegendentry{I mea3}

\addplot [color=mycolor4, line width=1.5pt]
  table[row sep=crcr]{%
1   0.0930952704092599\\
2   -0.351377292714917\\
3   -0.364956621960936\\
4   -0.575770960360392\\
5   -0.317065556651867\\
6   -1.00151115500967\\
7   -1.06380588863248\\
8   -0.931513440693155\\
9   -1.37439860156361\\
10  -1.25267983231092\\
11  -1.40670625541297\\
12  -1.36245757896058\\
13  -1.12145537274581\\
14  -1.74241343008912\\
15  -1.70985147724923\\
16  -1.09787908954558\\
17  -1.43430635038364\\
18  -1.09066379049329\\
19  -0.933138687752279\\
20  -0.880072997552445\\
21  -0.677946305875166\\
22  -0.976814941858187\\
23  -0.339623996678273\\
24  -0.334699156080242\\
25  -0.261138054572377\\
26  -0.0930952704092636\\
27  0.351377292714913\\
28  0.364956621960925\\
29  0.575770960360393\\
30  0.317065556651868\\
31  1.00151115500968\\
32  1.06380588863248\\
33  0.931513440693161\\
34  1.37439860156361\\
35  1.25267983231094\\
36  1.40670625541296\\
37  1.36245757896057\\
38  1.1214553727458\\
39  1.74241343008912\\
40  1.70985147724924\\
41  1.09787908954558\\
42  1.43430635038365\\
43  1.0906637904933\\
44  0.933138687752274\\
45  0.88007299755244\\
46  0.677946305875165\\
47  0.976814941858187\\
48  0.339623996678268\\
49  0.334699156080238\\
50  0.261138054572383\\
51  0.0930952704092541\\
52  -0.351377292714924\\
53  -0.364956621960928\\
54  -0.57577096036039\\
55  -0.317065556651866\\
56  -1.00151115500966\\
57  -1.06380588863247\\
58  -0.931513440693152\\
59  -1.37439860156361\\
60  -1.25267983231092\\
61  -1.40670625541298\\
62  -1.36245757896057\\
63  -1.1214553727458\\
64  -1.74241343008913\\
65  -1.70985147724924\\
66  -1.09787908954559\\
67  -1.43430635038364\\
68  -1.09066379049329\\
69  -0.93313868775229\\
70  -0.880072997552435\\
71  -0.677946305875159\\
72  -0.976814941858182\\
73  -0.339623996678275\\
74  -0.334699156080241\\
75  -0.261138054572372\\
76  -0.0930952704092618\\
77  0.351377292714916\\
78  0.364956621960944\\
79  0.575770960360398\\
80  0.317065556651869\\
81  1.00151115500967\\
82  1.06380588863249\\
83  0.931513440693154\\
84  1.37439860156361\\
85  1.25267983231092\\
86  1.40670625541297\\
87  1.36245757896058\\
88  1.1214553727458\\
89  1.74241343008912\\
90  1.70985147724923\\

442 1.43430635038365\\
443 1.09066379049319\\
444 0.9331386877523\\
445 0.880072997552365\\
446 0.677946305875166\\
447 0.976814941858134\\
448 0.33962399667825\\
449 0.334699156080208\\
450 0.261138054572396\\
451 0.0930952704092319\\
452 -0.351377292714914\\
453 -0.364956621960963\\
454 -0.575770960360377\\
455 -0.317065556651856\\
456 -1.00151115500971\\
457 -1.06380588863248\\
458 -0.931513440693168\\
459 -1.37439860156364\\
460 -1.25267983231089\\
461 -1.40670625541305\\
462 -1.36245757896056\\
463 -1.12145537274583\\
464 -1.74241343008912\\
465 -1.70985147724922\\
466 -1.09787908954561\\
467 -1.43430635038369\\
468 -1.09066379049328\\
469 -0.933138687752374\\
470 -0.880072997552431\\
471 -0.677946305875204\\
472 -0.976814941858136\\
473 -0.339623996678269\\
474 -0.334699156080243\\
475 -0.261138054572393\\
476 -0.0930952704092202\\
477 0.351377292714877\\
478 0.364956621960955\\
479 0.575770960360355\\
480 0.317065556651876\\
481 1.0015111550097\\
482 1.06380588863249\\
483 0.931513440693157\\
484 1.37439860156365\\
485 1.2526798323109\\
486 1.40670625541303\\
487 1.36245757896056\\
488 1.12145537274583\\
489 1.74241343008917\\
490 1.70985147724922\\
491 1.09787908954559\\
492 1.43430635038368\\
493 1.09066379049326\\
494 0.933138687752356\\
495 0.880072997552424\\
496 0.677946305875208\\
497 0.976814941858176\\
498 0.339623996678291\\
499 0.334699156080269\\
500 0.261138054572392\\
};
\addlegendentry{I mea4}

\addplot [color=mycolor5, line width=1.5pt]
  table[row sep=crcr]{%
1   0.293723555964629\\
2   -0.56352602359513\\
3   -0.403494408837694\\
4   -0.357595265131495\\
5   -0.314085018231301\\
6   -1.0388528260386\\
7   -1.09784757886932\\
8   -0.990552910162822\\
9   -1.13926292350276\\
10  -1.43558507547688\\
11  -1.56055984323431\\
12  -1.26291646505848\\
13  -1.15909937241561\\
14  -1.65162288335722\\
15  -1.83394619867657\\
16  -1.28216984575931\\
17  -1.21981372338249\\
18  -1.08698299912443\\
19  -0.908707083022748\\
20  -0.928018902864261\\
21  -0.81783931245382\\
22  -0.798529333579147\\
23  -0.205722802853008\\
24  -0.477794888372556\\
25  -0.205882480447996\\
26  -0.29372355596463\\
27  0.563526023595127\\
28  0.403494408837685\\
29  0.357595265131501\\
30  0.314085018231304\\
31  1.03885282603861\\
32  1.09784757886932\\
33  0.99055291016283\\
34  1.13926292350275\\
35  1.43558507547689\\
36  1.56055984323431\\
37  1.26291646505848\\
38  1.1590993724156\\
39  1.65162288335723\\
40  1.83394619867657\\
41  1.2821698457593\\
42  1.21981372338251\\
43  1.08698299912444\\
44  0.908707083022736\\
45  0.928018902864257\\
46  0.817839312453816\\
47  0.798529333579143\\
48  0.205722802853007\\
49  0.477794888372546\\
50  0.205882480448003\\
51  0.293723555964618\\
52  -0.563526023595134\\
53  -0.403494408837681\\
54  -0.357595265131498\\
55  -0.3140850182313\\
56  -1.03885282603859\\
57  -1.09784757886931\\
58  -0.990552910162816\\
59  -1.13926292350276\\
60  -1.43558507547687\\
61  -1.56055984323433\\
62  -1.26291646505847\\
63  -1.1590993724156\\
64  -1.65162288335723\\
65  -1.83394619867659\\
66  -1.28216984575932\\
67  -1.21981372338249\\
68  -1.08698299912443\\
69  -0.908707083022758\\
70  -0.928018902864254\\
71  -0.81783931245381\\
72  -0.798529333579133\\
73  -0.205722802853021\\
74  -0.477794888372557\\
472 -1.10404138602374\\
473 -0.143587572670135\\
474 -0.395120160926706\\
475 -0.273805246419986\\
476 -0.210718161375232\\
477 0.446197076672017\\
478 0.253374698236892\\
479 0.572358120430165\\
480 0.25688255682071\\
481 0.965395779751314\\
482 1.14179443236884\\
483 0.831670880063494\\
484 1.31591624485353\\
485 1.28324097235944\\
486 1.47356858716494\\
487 1.40759962165334\\
488 1.07697727929633\\
489 1.86057142067132\\
490 1.80096502813118\\
491 0.976974988117164\\
492 1.4929441515391\\
493 1.02262685124339\\
494 0.943856146110668\\
495 0.716987154062693\\
496 0.580781811549276\\
497 1.10404138602381\\
498 0.143587572670168\\
499 0.395120160926729\\
500 0.273805246419989\\
};
\addlegendentry{I mea6}

\end{axis}
\end{tikzpicture}%
\end{document}

答案1

  • 你的 MWE(最小工作示例)远非最小,它还包含错误并且不可编译
  • 关于图例的定位,请参阅4.9.5 图例外观在 pgfplots 手册第 257 页,版本 1.17˙
  • 你的情况是更换轴选项
legend style={legend cell align=left, 
              at={(0.8,0.1)}, 
              anchor=south, 
              draw=white!15!black}

legend style={
              legend cell align=left, % this line not needed
              cells={anchor=east},
              legend pos=outer north east,
             },
  • 在更改axis序言之后,修复后的 MWE(删除了表中的空行)的结果是:

在此处输入图片描述

相关内容