\documentclass[tikz,border=5pt]{standalone}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usepgfplotslibrary{colorbrewer}
\usepackage{xcolor}
\usepackage{tikz}
\pgfplotsset{
legend image with text/.style={
legend image code/.code={
\node[anchor=center] at (0.3cm,0cm) {#1};
}
},
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=Confidence,
ylabel=Accuracy,
xtick pos=left,
ytick pos=left,
ymajorgrids=true,
xmin=0.3, xmax=1,
ymin=0.3, ymax=1,
height=7cm, width=8cm,
legend pos=south east,
legend style={nodes={scale=0.8, transform shape}},
title=CIFAR-10C Pixelate Level 1
]
\addplot [black, dotted, forget plot, thick] {x};
\addplot+[red, mark options={red}, mark size=1.2pt, mark=*, error bars/.cd, y dir=both, y explicit,] table [x=x, y=y, col sep=comma] {
x, y
0.5024452805519104, 0.496
0.739465594291687, 0.656
0.8858099579811096, 0.828
0.9479743838310242, 0.91
0.9701435565948486, 0.954
0.9795498251914978, 0.972
0.9842259287834167, 0.994
0.9868590831756592, 0.994
0.9886232614517212, 0.988
0.9899592995643616, 0.994
0.9910444617271423, 0.994
0.9919534921646118, 0.996
0.9927447438240051, 0.996
0.9934417009353638, 0.996
0.9941386580467224, 0.998
0.9947934150695801, 1.0
0.9954931139945984, 0.998
0.9962482452392578, 0.996
0.9970769286155701, 0.998
0.9983670115470886, 1.0
};
\addlegendentry{SWA + Temp}
\addplot+[orange, mark options={orange}, mark size=1.2pt, mark=*, error bars/.cd, y dir=both, y explicit,] table [x=x, y=y, col sep=comma] {
x, y
0.46610355377197266, 0.472
0.6662368774414062, 0.646
0.8106646537780762, 0.754
0.9092094302177429, 0.868
0.9621589183807373, 0.948
0.983908474445343, 0.932
0.992878794670105, 0.974
0.9963887333869934, 0.99
0.9979416728019714, 0.988
0.998647153377533, 0.988
0.9990418553352356, 0.998
0.9992789626121521, 0.994
0.9994261264801025, 0.998
0.9995367527008057, 1.0
0.9996228218078613, 0.996
0.999692976474762, 1.0
0.9997546672821045, 1.0
0.9998094439506531, 1.0
0.9998660087585449, 1.0
0.9999310374259949, 1.0
};
\addlegendentry{SWAGD}
\addplot+[blue, mark options={blue}, mark size=1.2pt, mark=*, error bars/.cd, y dir=both, y explicit,] table [x=x, y=y, col sep=comma] {
x, y
0.42042890191078186, 0.47
0.5398436784744263, 0.66
0.680404782295227, 0.784
0.8418894410133362, 0.85
0.947942852973938, 0.916
0.9833580255508423, 0.954
0.9937726855278015, 0.976
0.9969081878662109, 0.984
0.9982129335403442, 0.992
0.9988493919372559, 0.99
0.9991578459739685, 0.998
0.9993464350700378, 0.998
0.9994758367538452, 0.99
0.9995732307434082, 0.994
0.9996508955955505, 0.996
0.9997183680534363, 1.0
0.9997795224189758, 0.998
0.9998345971107483, 1.0
0.9998872876167297, 1.0
0.9999464154243469, 1.0
};
\addlegendentry{ACNML + SWAGD}
\addplot+[purple!60!black, mark options={purple!60!black}, mark size=1.2pt, mark=*, error bars/.cd, y dir=both, y explicit,] table [x=x, y=y, col sep=comma] {
x, y
0.48948559165000916, 0.48
0.6891394257545471, 0.74
0.8355490565299988, 0.866
0.9218644499778748, 0.918
0.9660996198654175, 0.96
0.985666036605835, 0.982
0.9934399127960205, 0.98
0.9965226054191589, 0.996
0.9978374242782593, 0.988
0.9984903931617737, 0.996
0.9988275170326233, 1.0
0.9990243315696716, 1.0
0.9991487264633179, 1.0
0.9992461800575256, 1.0
0.9993250966072083, 1.0
0.9993953704833984, 1.0
0.9994593858718872, 0.998
0.9995235204696655, 1.0
0.999596118927002, 0.998
0.9997142553329468, 1.0
};
\addlegendentry{Ensemble}
\addplot+[black!60!green, mark options={black!60!green}, mark size=1.2pt, mark=*, error bars/.cd, y dir=both, y explicit,] table [x=x, y=y, col sep=comma] {
x, y
0.4299602806568146, 0.524
0.5586177706718445, 0.614
0.7363007068634033, 0.84
0.875036358833313, 0.902
0.9355190992355347, 0.958
0.9621126055717468, 0.978
0.9740251898765564, 0.992
0.9800118207931519, 0.988
0.9835213422775269, 0.994
0.9858382344245911, 0.988
0.987562358379364, 0.996
0.9888783097267151, 0.998
0.9900496602058411, 0.998
0.9910144805908203, 0.998
0.9919239282608032, 0.998
0.9928650856018066, 1.0
0.9938008785247803, 0.998
0.9947590231895447, 0.998
0.9958503246307373, 1.0
0.9975370168685913, 1.0
};
\addlegendentry{IF-COMP}
\end{axis}
\end{tikzpicture}
\end{document}