summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgfplots/test/pgfplotstest/pgfplotstest.errorbars.tex
blob: c90f00287e6c573b95b72695abf674f4540b823f (plain)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
\testfile{pgfplotstest.errorbars.tex}
\testsection{Errorbars}
{
%\tracingmacros=2\tracingcommands=2
\begin{tikzpicture}
\begin{axis}
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=both,y explicit,
	x dir=both,x fixed relative=0.5,
	error mark=diamond*,
]
	coordinates
	{(0,0) +- (0.5,0.1) 
	(0.1,0.1)  +- (0.05,0.2)
	(0.2,0.2) 	+- (0,0.05)
	(0.5,0.5)
	(1,1)};
\end{axis}
\end{tikzpicture}

\testsubsubsection{changing styles}
\begin{tikzpicture}
\begin{axis}
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=plus,y explicit,
	error bar style={black,dotted,/pgfplots/error bars/error mark=square*,/pgfplots/error bars/error mark options={current plot style}},
]
	coordinates
	{(0,0) +- (0.5,0.1) 
	(0.1,0.1)  +- (0.05,0.2)
	(0.2,0.2) 	+- (0,0.05)
	(0.5,0.5) +- (0.1,0.2)
	(1,1) +- (0.3,0.1)
	};
\end{axis}
\end{tikzpicture}

\testsubsubsection{using 100\% minus}
\begin{tikzpicture}
\begin{axis}
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=minus,y fixed relative=1,
	x dir=minus,x fixed relative=1,
	error mark=none,
	error bar style={dotted},
]
	coordinates
	{(0,0) 
	(0.1,0.1)  
	(0.2,0.2) 	
	(0.5,0.5) 
	(1,1) 
	};
\end{axis}
\end{tikzpicture}
%
\testsubsubsection{with plot table}
\begin{sidewaystable}
{%
\lstset{
	showtabs=true,
	showspaces=true,
	basicstyle=\footnotesize\ttfamily,
	numbers=left,
	numberblanklines=true,
	breaklines=false,
	tabsize=15}
\lstinputlisting{plotdata/pgfplotstest_plot}
}
\caption{The table used for the plot table tests and error bars.}
\label{tbl:k}
\end{sidewaystable}

\begin{tikzpicture}
\begin{axis}[title={maxlevel versus cgiter, table~\ref{tbl:k}}]
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=both,y explicit,
] table[x=maxlevel,y=cgiter,y error=cgiter_err] {plotdata/pgfplotstest_plot};

\end{axis}
\end{tikzpicture}

\testsubsection{Log-plot}
\testsubsubsection{relative errors}
\begin{tikzpicture}
\begin{loglogaxis}[
	grid=both]
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=both,y explicit relative,
	x dir=both,x fixed relative=0.5,
	error mark=triangle*,
]
	coordinates {
		(32,32)
		(64,64)
		(128,128) +- (0,0.3)
		(1024,1024) +- (0,0.2)
		(32068,32068)  +- (0,0.6)
		(64000,64000) +- (0,0.6)
		(128000,128000) +- (0,0.6)
	};

\end{loglogaxis}
\end{tikzpicture}

\testsubsubsection{x fixed=500, y explicit relative}
\begin{tikzpicture}
\begin{loglogaxis}[
	grid=both]
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=both,y explicit relative,
	x dir=both,x fixed=500,
	error mark=triangle*,
]
	coordinates {
		(32,32)
		(64,64)
		(128,128) +- (0,0.3)
		(1024,1024) +- (0,0.2)
		(32068,32068)  +- (0,0.6)
		(64000,64000) +- (0,0.6)
		(128000,128000) +- (0,0.6)
	};

\end{loglogaxis}
\end{tikzpicture}

\testsubsubsection{with plot table}
\begin{tikzpicture}
\begin{loglogaxis}[title={dof versus Lmax, table~\ref{tbl:k}}]
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=both,y explicit relative,
] table[x=dof,y=Lmax,y error=Lmax_relerror] {plotdata/pgfplotstest_plot};
\end{loglogaxis}
\end{tikzpicture}

\testsubsubsection{with plot table absolute}
\begin{tikzpicture}
\begin{loglogaxis}[grid=both,title={dof versus L2, table~\ref{tbl:k}}]
\addplot plot[
	/pgfplots/error bars/.cd,
	y dir=both,y explicit,
] table[x=dof,y=L2,y error=L2_abserror] {plotdata/pgfplotstest_plot};
\end{loglogaxis}
\end{tikzpicture}
}