在 tikz 中更改标记形状

在 tikz 中更改标记形状

你好,我想知道如何获取附图中出现的以下标记:

在此处输入图片描述

这是 mwe,其坐标为:

\documentclass{standalone}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{pgfplots, pgfplotstable}
\usetikzlibrary{positioning}
\pgfplotsset{compat=1.16,width=0.98\textwidth}
%\pgfplotsset{compat=1.16,width=0.98\textwidth}

\usepackage{tikz}
\usepackage[english,spanish]{babel}         % multilenguaje

% grid style

\pgfdeclareplotmark{mystar}{
    \node[star,star point ratio=2.25,minimum size=6pt,
    inner sep=0pt,draw=black,solid,fill=red] {};
}

\decimalpoint

\begin{document}



    \begin{tikzpicture}



    \begin{axis}[
    axis line style={black},
    legend cell align={left},
    legend style={draw=black},
    tick align=outside,
    x grid style={dashed,black!60},
    xlabel={Factors},
    xmajorticks=true,
    xmin=-2.9, xmax=104.9,
    xtick style={color=black},
    y grid style={dashed,black!60},
    ylabel={RMSE},
    ymajorticks=true,
    ymin=0.850729240029497, ymax=0.905193204319348,
    ytick style={black},
    xtick align=inside,
    ytick align=inside,
    grid = both
    ]
    \addplot [mark =+,line width=1pt,blue, mark size=1.5pt]
table {%
2 0.9027175695789
4 0.897861765753183
6 0.893821397659722
8 0.89167759352437
10 0.890551599520123
12 0.888834355758449
14 0.887930955413864
16 0.885401265676267
18 0.885753330175654
20 0.884851333015314
22 0.882782795881261
24 0.884073576732794
26 0.883357689247054
28 0.882637401807809
30 0.881827318909257
32 0.880868384904793
34 0.880414582422335
36 0.881214601730437
38 0.880797790575084
40 0.880083948931917
42 0.879416420664705
44 0.879269387274515
46 0.878989619573857
48 0.878556912902045
50 0.877421327240298
52 0.877965495433542
54 0.878422158855753
56 0.878127248471313
58 0.87750293736373
60 0.87680205401383
62 0.877449600310002
64 0.876374765556333
66 0.876312232314794
68 0.876289537279491
70 0.876433126606857
72 0.87596408140049
74 0.876502034778549
76 0.8756132598436
78 0.875632080742398
80 0.875830560502087
82 0.875790853143759
84 0.87511861273585
86 0.875290527166252
88 0.874763763228041
90 0.874670881957083
92 0.874777253932595
94 0.875094574395115
96 0.874618277424289
98 0.874353724851183
100 0.874224412254549
};
\addlegendentry{10 Epochs}
\addplot [mark =pentagon,line width=1pt,black, mark size=1pt]
table {%
2 0.893965950660986
4 0.877178487377105
6 0.868048018249951
8 0.863619771894904
10 0.862358525162387
12 0.860567557679823
14 0.85901633701034
16 0.858781243869266
18 0.85793281733103
20 0.857478757959634
22 0.856967731981797
24 0.856982301616069
26 0.856276932136137
28 0.856365550775885
30 0.856155724722585
32 0.856169829946455
34 0.855384298607299
36 0.855279233058811
38 0.85546563229391
40 0.85579969761625
42 0.855198248818938
44 0.855228136868508
46 0.855624052519119
48 0.854573567450464
50 0.854848009928109
52 0.854806444261156
54 0.854295384317586
56 0.854165536251013
58 0.853955596275106
60 0.854143916356813
62 0.854837202390947
64 0.85388858778051
66 0.854042963949735
68 0.85380657736742
70 0.853938320185388
72 0.853739505091974
74 0.85383626792236
76 0.853756644780337
78 0.853740857078015
80 0.8538327223226
82 0.853204874769945
84 0.853365486648567
86 0.853608719419868
88 0.853741193199706
90 0.853346774366576
92 0.853683738911195
94 0.853817416928146
96 0.853427382787991
98 0.85320939503722
100 0.853224709031221
};
\addlegendentry{50 Epochs}
\addplot [mark =o,line width=1pt,green!80!black, mark size=1pt]
table {%
2 0.892477092241751
4 0.874375587826647
6 0.865459122236675
8 0.859720582103558
10 0.857563419800796
12 0.8562970446962
14 0.85654686979103
16 0.855867967721758
18 0.855561722032013
20 0.855264280083319
22 0.855375658856436
24 0.855671055604809
26 0.855473481535516
28 0.855618048639852
30 0.8559664674943
32 0.8553812735106
34 0.855040438156959
36 0.855848986213965
38 0.854961447422692
40 0.855694341911187
42 0.854908091093988
44 0.854649546159086
46 0.855163707005447
48 0.854911772037089
50 0.854435476690489
52 0.854719404514123
54 0.854800857421306
56 0.854989053592751
58 0.854537407268663
60 0.855124104264201
62 0.854290422967868
64 0.854250166064977
66 0.854616120692891
68 0.854776024514124
70 0.854341819058734
72 0.853944727445416
74 0.853995103329721
76 0.85416121764191
78 0.854022568594074
80 0.85366285800442
82 0.854154959842634
84 0.853983610568726
86 0.853691071737578
88 0.854029303593835
90 0.853809278352962
92 0.85337768040668
94 0.85379852055249
96 0.853321573691484
98 0.853298422548886
100 0.853549140640288
};
\addlegendentry{100 Epochs}
\end{axis}

\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

这些标记看起来像误差线。

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{positioning}
\pgfplotsset{compat=1.16,width=0.98\textwidth}

\begin{document}
    \begin{tikzpicture}
    \begin{axis}[
    axis line style={black},
    legend cell align={left},
    legend style={draw=black},
    tick align=outside,
    x grid style={dashed,black!60},
    xlabel={Factors},
    xmajorticks=true,
    xmin=-2.9, xmax=104.9,
    xtick style={color=black},
    y grid style={dashed,black!60},
    ylabel={RMSE},
    ymajorticks=true,
    ymin=0.850729240029497, ymax=0.905193204319348,
    ytick style={black},
    xtick align=inside,
    ytick align=inside,
    grid = both,
    legend image post style={sharp plot,|-|} %https://tex.stackexchange.com/a/317002/121799
    ]
    \addplot [mark =*,line width=1pt,blue, mark size=1.5pt,error bars/.cd,
            y dir=both, y fixed=0.001]
table {%
2 0.9027175695789
4 0.897861765753183
6 0.893821397659722
8 0.89167759352437
10 0.890551599520123
12 0.888834355758449
14 0.887930955413864
16 0.885401265676267
18 0.885753330175654
20 0.884851333015314
22 0.882782795881261
24 0.884073576732794
26 0.883357689247054
28 0.882637401807809
30 0.881827318909257
32 0.880868384904793
34 0.880414582422335
36 0.881214601730437
38 0.880797790575084
40 0.880083948931917
42 0.879416420664705
44 0.879269387274515
46 0.878989619573857
48 0.878556912902045
50 0.877421327240298
52 0.877965495433542
54 0.878422158855753
56 0.878127248471313
58 0.87750293736373
60 0.87680205401383
62 0.877449600310002
64 0.876374765556333
66 0.876312232314794
68 0.876289537279491
70 0.876433126606857
72 0.87596408140049
74 0.876502034778549
76 0.8756132598436
78 0.875632080742398
80 0.875830560502087
82 0.875790853143759
84 0.87511861273585
86 0.875290527166252
88 0.874763763228041
90 0.874670881957083
92 0.874777253932595
94 0.875094574395115
96 0.874618277424289
98 0.874353724851183
100 0.874224412254549
};
\addlegendentry{10 Epochs}
\addplot [mark =*,line width=1pt,black, mark size=1pt,error bars/.cd,
            y dir=both, y fixed=0.001]
table {%
2 0.893965950660986
4 0.877178487377105
6 0.868048018249951
8 0.863619771894904
10 0.862358525162387
12 0.860567557679823
14 0.85901633701034
16 0.858781243869266
18 0.85793281733103
20 0.857478757959634
22 0.856967731981797
24 0.856982301616069
26 0.856276932136137
28 0.856365550775885
30 0.856155724722585
32 0.856169829946455
34 0.855384298607299
36 0.855279233058811
38 0.85546563229391
40 0.85579969761625
42 0.855198248818938
44 0.855228136868508
46 0.855624052519119
48 0.854573567450464
50 0.854848009928109
52 0.854806444261156
54 0.854295384317586
56 0.854165536251013
58 0.853955596275106
60 0.854143916356813
62 0.854837202390947
64 0.85388858778051
66 0.854042963949735
68 0.85380657736742
70 0.853938320185388
72 0.853739505091974
74 0.85383626792236
76 0.853756644780337
78 0.853740857078015
80 0.8538327223226
82 0.853204874769945
84 0.853365486648567
86 0.853608719419868
88 0.853741193199706
90 0.853346774366576
92 0.853683738911195
94 0.853817416928146
96 0.853427382787991
98 0.85320939503722
100 0.853224709031221
};
\addlegendentry{50 Epochs}
\addplot [mark=*,line width=1pt,green!80!black, mark size=1pt,error bars/.cd,
            y dir=both, y fixed=0.001]
table {%
2 0.892477092241751
4 0.874375587826647
6 0.865459122236675
8 0.859720582103558
10 0.857563419800796
12 0.8562970446962
14 0.85654686979103
16 0.855867967721758
18 0.855561722032013
20 0.855264280083319
22 0.855375658856436
24 0.855671055604809
26 0.855473481535516
28 0.855618048639852
30 0.8559664674943
32 0.8553812735106
34 0.855040438156959
36 0.855848986213965
38 0.854961447422692
40 0.855694341911187
42 0.854908091093988
44 0.854649546159086
46 0.855163707005447
48 0.854911772037089
50 0.854435476690489
52 0.854719404514123
54 0.854800857421306
56 0.854989053592751
58 0.854537407268663
60 0.855124104264201
62 0.854290422967868
64 0.854250166064977
66 0.854616120692891
68 0.854776024514124
70 0.854341819058734
72 0.853944727445416
74 0.853995103329721
76 0.85416121764191
78 0.854022568594074
80 0.85366285800442
82 0.854154959842634
84 0.853983610568726
86 0.853691071737578
88 0.854029303593835
90 0.853809278352962
92 0.85337768040668
94 0.85379852055249
96 0.853321573691484
98 0.853298422548886
100 0.853549140640288
};
\addlegendentry{100 Epochs}
\end{axis}

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容