-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfig4.tex
99 lines (92 loc) · 2.62 KB
/
fig4.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{calc}
%% refer to fig4 in https://papers.nips.cc/paper/2020/file/83eaa6722798a773dd55e8fc7443aa09-Paper.pdf
\begin{document}
\begin{tikzpicture}
% \plotdata{number}{color}{other options}
\newcommand{\plotdata}[3]{
\addplot[#2,#3,line width=.6pt] table [x=X, y=data#1] {\datatable};
\addplot[name path=A#1, draw=none,forget plot] table [x=X, y=data#1l] {\datatable};
\addplot[name path=B#1, draw=none,forget plot] table [x=X, y=data#1u] {\datatable};
\addplot[#2!20,forget plot] fill between[of=A#1 and B#1];
}
% read the external table
\pgfplotstableread[col sep=comma]{datafile1.csv}{\datatable}
\pgfplotsset{
title style={
at={(0.5,-0.25)},
align=left,
anchor=north,
},
subplotStyle/.style n args ={1}{
smooth, no markers,
width = 0.4\linewidth,
height = 0.35\linewidth,
axis x line=bottom,
axis y line=left,
enlargelimits=auto,
xmin=0,
},
}
\newcommand{\subplotoffset}{0.05\linewidth}
\newcommand{\mygreen}{green!60!black}
%% plot1 ------------------------------
\begin{axis}[
name=plot1,
title={(a) Single-circle},
ylabel={Root\\ Mean\\ Squared\\ Error\\ Averged\\ Over\\ 20runs},
ylabel style={
rotate=-90,
anchor=center,
align=center,
scale={0.7},
at={(0.1,0.5)},
},
legend entries={Implicit,MDN-3,MDN-4,MDN-6,KDE},
legend columns=-1,
legend style={
fill=none,
},
legend to name={legendName},
subplotStyle={},
]
\plotdata{1}{red}{}
\plotdata{2}{\mygreen}{}
\plotdata{3}{\mygreen}{dotted}
\plotdata{4}{\mygreen}{dashdotted}
\addplot[blue,line width=.6pt] coordinates {(0,0.5) (100,0.5)};
\end{axis}
%% plot2 --------------------------
\begin{axis}[
name=plot2,
at={($(plot1.east)+(\subplotoffset,0)$)},
anchor=west,
title={(b) Double-circle},
subplotStyle={},
]
\plotdata{5}{red}{}
\plotdata{6}{\mygreen}{}
\plotdata{7}{\mygreen}{dotted}
\plotdata{8}{\mygreen}{dashdotted}
\addplot[blue,line width=.6pt] coordinates {(0,1) (100,1)};
\end{axis}
%% plot3 ------------------------------------
\begin{axis}[
name=plot3,
at={($(plot2.east)+(\subplotoffset,0)$)},
anchor=west,
title={(c) High-dimentional \\Double-circle},
subplotStyle={},
]
\plotdata{5}{red}{}
\plotdata{6}{\mygreen}{}
\plotdata{7}{\mygreen}{dotted}
\plotdata{8}{\mygreen}{dashdotted}
\addplot[blue,line width=.6pt] coordinates {(0,4) (100,4)};
\end{axis}
\node [] (mylegendnode) at ($(plot1.south)!0.5!(plot3.south)+(0,-0.15\linewidth)$) {\pgfplotslegendfromname{legendName}};
%\ref{legendName}
\end{tikzpicture}
\end{document}