summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pgfplots/manual.reference.tex
blob: 5cb97da208095f4afad0fb960f12b27d7c3ecfef (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
% main=manual.tex

\section{Reference}
\subsection{The axis--environments}
There are four axis environments,
\begin{enumerate}
\item The axis environment for normal plots,
\begin{lstlisting}
\begin{axis}
...
\end{axis}
\end{lstlisting}

\item The axis environment for logarithmic scaling of~$x$ and normal scaling of~$y$,
\begin{lstlisting}
\begin{semilogxaxis}
...
\end{semilogxaxis}
\end{lstlisting}

\item The axis environment for normal scaling of~$x$ and logarithmic scaling of~$y$,
\begin{lstlisting}
\begin{semilogyaxis}
...
\end{semilogyaxis}
\end{lstlisting}

\item The axis environment for logarithmic scaling of both, $x$~and~$y$ axes,
\begin{lstlisting}
\begin{loglogaxis}
...
\end{loglogaxis}
\end{lstlisting}
\end{enumerate}
They are all equivalent to
\begin{lstlisting}
\begin{axis}[
	xmode=log|normal,
	ymode=log|normal]
...
\end{axis}
\end{lstlisting}
with properly set variables `\texttt{xmode}' and `\texttt{ymode}' (see below).

\subsection{Available markers}
\label{sec:markers}%
The following options of \Tikz\ may be useful for plots.
\subsubsection{Markers}
This list is copied from~\cite[section~29]{tikz}:
\begingroup
\newenvironment{longdescription}[0]{%
	\begin{list}{}{%
		\leftmargin=4.3cm
		\setlength{\labelwidth}{4.3cm}%
		\renewcommand{\makelabel}[1]{\hfill\textbf{\texttt{##1}}}%
	}%
}{%
	\end{list}%
}%
\def\showit#1{%
	\tikz\draw[%
		gray,
		thin,
		mark options={fill=yellow!80!black,draw=black,scale=2},
		x=0.8cm,y=0.3cm,
		#1]
	plot coordinates {(0,0) (1,1) (2,0) (3,1)};%
}%
\begin{longdescription}
	\item[mark=*] \showit{mark=*}
	\item[mark=x] \showit{mark=x}
	\item[mark=+] \showit{mark=+}
\end{longdescription}
And with \lstinline!\usetikzlibrary{plotmarks}!:
\begin{longdescription}
	\item[mark=$-$] \showit{mark=-}
	\item[mark=$|$] \showit{mark=|}
	\item[mark=o] \showit{mark=o}
	\item[mark=asterisk] \showit{mark=asterisk}
	\item[mark=star] \showit{mark=star}
	\item[mark=oplus] \showit{mark=oplus}
	\item[mark=oplus*] \showit{mark=oplus*}
	\item[mark=otimes] \showit{mark=otimes}
	\item[mark=otimes*] \showit{mark=otimes*}
	\item[mark=square] \showit{mark=square}
	\item[mark=square*] \showit{mark=square*}
	\item[mark=triangle] \showit{mark=triangle}
	\item[mark=triangle*] \showit{mark=triangle*}
	\item[mark=diamond] \showit{mark=diamond}
	\item[mark=diamond*] \showit{mark=diamond*}
	\item[mark=pentagon] \showit{mark=pentagon}
	\item[mark=pentagon*] \showit{mark=pentagon*}
\end{longdescription}
All these options have been drawn with the additional options
\begin{lstlisting}
\draw[
	gray,
	thin,
	mark options={scale=2,fill=yellow!80!black,draw=black}]
\end{lstlisting}

\subsubsection{Line styles}
\def\showit#1{%
	\tikz\draw[%
		black,
		x=0.8cm,y=0.3cm,
		#1]
	plot coordinates {(0,0) (1,1) (2,0) (3,1)};%
}%
The following line styles are predefined in \Tikz:
\begin{longdescription}
	\item[style=solid] \showit{style=solid}
	\item[style=dotted] \showit{style=dotted}
	\item[style=densely dotted] \showit{style=densely dotted}
	\item[style=loosely dotted] \showit{style=loosely dotted}
	\item[style=dashed] \showit{style=dashed}
	\item[style=densely dashed] \showit{style=densely dashed}
	\item[style=loosely dashed] \showit{style=loosely dashed}
\end{longdescription}
You may need the option \lstinline!mark options={solid}! to avoid dotted or dashed marker boundaries. The string ``\texttt{style=}'' can be omitted.
\endgroup

\subsection{\texttt{\textbackslash addplot[OPTIONS] PATH}}
This is the main plotting command. It is used as
\begin{lstlisting}
\addplot 
	plot coordinates {
		(0,0)
		(1,1)
	};
\end{lstlisting}
or
\begin{lstlisting}
\addplot[color=blue,mark=*]
	plot coordinates {
		(0,0)
		(1,1)
	};
\end{lstlisting}
The first syntax chooses the next unused plot specification of the list \lstinline!\autoplotspeclist! (see below) and the second syntax specifies a plot specification explicitly. This specification will be used inside of the legend (if any).

\noindent
Some more details:
\begin{itemize}
	\item \lstinline!\addplot! is a shortcut for \lstinline!\draw[OPTIONS]!, that means anything up to the next semicolon is part of a \PGF-path. The semicolon is required.
	\item The \texttt{OPTIONS} are remembered for the legend.
	\item See subsection~\ref{sec:markers} for a list of available markers and line styles.
	\item You can modify \texttt{OPTIONS} with
	\begin{lstlisting}[gobble=1]
	\tikzstyle{every axis plot}=[...]
	\end{lstlisting}
	\item For log plots, \PGFPlots\ will compute the natural logarithm $\log(\cdot)$ numerically. This works with normal fixed point numbers or in scientific notation. For example, the following numbers are valid input to \lstinline!\addplot!.
\begin{lstlisting}
\begin{loglogaxis}
\addplot plot coordinate {
	(769,	1.6227e-04)
	(1793,	4.4425e-05)
	(4097,	1.2071e-05)
	(9217,	3.2610e-06)
	(1e6,	0.00003341)
	(2.3e7,	0.00131415)
;
\end{loglogaxis}
\end{lstlisting}
	You can represent arbirtrarily small or very large numbers as long as its logarithm can be represented as a \TeX-length (up to about~$16384$). Of course, any coordinate~$x\le 0$ is not possible since the logarithm of a non-positive number is not defined. Such coordinates will be skipped automatically.

	\item As a consequence of the coordinate parsing routines, you can't use the mathematical expression parsing method of \PGF\ as coordinates.
	
	\item If you did not specify axis limits for $x$ and $y$ manually, \lstinline!\addplot! will compute them automatically. 

	The automatic computation of axis limits works as follows:
		\begin{enumerate}
			\item In case of \lstinline!\addplot plot coordinates {...};!, every coordinate will be checked.
			Any other \Tikz-plot mode is not (yet) supported (had no time yet).
			\item Since more than one \lstinline!\addplot! command may be used inside an \lstinline!\begin{axis}...\end{axis}!, all drawing commands will be postponed until \lstinline!\end{axis}!.

			See the \lstinline!\axispath!-command for more information about automatic axis limits and the postponed drawing.
		\end{enumerate}
\end{itemize}

\subsection{\texttt{\textbackslash axispath...;}}
This command allows to draw custom content into an axis. The argument to \lstinline!\axispath! may be any \Tikz-command like 
\begin{lstlisting}
\axispath\node at (12.14368,-9.30872) {};
\end{lstlisting}
or
\begin{lstlisting}
\axispath\draw (12.14368,-9.30872) -- (0,1);
\end{lstlisting}
A useful example is presented in section~\ref{sec:annot:plot} where annotations are placed near some data points.

The \lstinline!\axispath! command is necessary to communicate drawing commands to \PGFPlots. If \PGFPlots\ needs to determine the $x$~and/or~$y$ limits automatically, any plotting commands (including those with \lstinline!\axispath!) will be postponed until \lstinline!\end{axis}!.

A missing \lstinline!\axispath! may corrupt your graphics because the clipping area may not yet be known.

\subsection{\texttt{\textbackslash addlegendentry\{name\}}}
Adds a single legend entry to the legend list. Example:
\begin{lstlisting}
\begin{axis}
\addplot[smooth,mark=*,blue] plot coordinates {
	(0,2)
	(2,3)
	(3,1)
};
\addlegendentry{Case 1}

\addplot[smooth,color=red,mark=x]
	plot coordinates {
		(0,0)
		(1,1)
		(2,1)
		(3,2)
	};
\addlegendentry{Case 2}
\end{axis}
\end{lstlisting}
The outcome of this listing is shown in figure~\ref{fig:addlegendentry}.
\begin{figure}
	\centering
	\begin{tikzpicture}
	\begin{axis}
	\addplot[smooth,mark=*,blue] plot coordinates {
		(0,2)
		(2,3)
		(3,1)
	};
	\addlegendentry{Case 1}

	\addplot[smooth,color=red,mark=x]
		plot coordinates {
			(0,0)
			(1,1)
			(2,1)
			(3,2)
		};
	\addlegendentry{Case 2}
	\end{axis}
	\end{tikzpicture}

	\caption{An example for the \texttt{\textbackslash addlegendentry} command}%
	\label{fig:addlegendentry}%
\end{figure}%
It does not matter where \lstinline!\addlegendentry! commands are placed, only the sequence matters. You will need one \lstinline!\addlegendentry! for every \lstinline!\addplot! command.

You may also consider the command \lstinline!\legend!. It also accepts several formatting options.

\subsection{\texttt{\textbackslash legend[OPTIONS]\{LIST\}}}
\label{sec:legenddef}%
You can use
\begin{lstlisting}
\begin{tikzpicture}
\begin{axis}
...
\legend{$d=2$\\$d=3$\\$d=4$\\$d=5$\\$d=6$\\}
...
\end{axis}
\end{tikzpicture}
\end{lstlisting}
to assign a complete legend. The \lstinline!\legend! command takes the following arguments:
\begin{lstlisting}
\legend[OPTIONS]{TEXT1\\TEXT2\\TEXT3\\...\\}
\end{lstlisting}
where each legend element needs to be terminated by \lstinline!\\!. If \texttt{LIST} is empty, the current legend will not be touched (see \lstinline!\addlegendentry!). The short marker/line combination shown in legends is acquired from the argument to \lstinline!\addplot[...]!.

\subsubsection{Legend appearance}
The style ``\texttt{every axis legend}'' determines the legend's position and outer appearance:
\begin{lstlisting}
\tikzstyle{every axis legend}+=[
		at={(0,0)},
		anchor=south west]
\end{lstlisting}
will draw it at the lower left corner of the axis while
\begin{lstlisting}
\tikzstyle{every axis legend}+=[
		at={(1,1)},
		anchor=north east]
\end{lstlisting}
means the upper right corner. The `\texttt{anchor}' option determines which point \emph{of the legend} will be placed at $(0,0)$ or $(1,1)$ (see below for more examples).

The legend is a node, so you can use any \Tikz\ option which affects
nodes (see~\cite[section~13]{tikz}). The node's option ``\texttt{text width}'' is set automatically, depending on the \lstinline!\legend[textwidth=...]! option.

Examples:
\begin{itemize}
\item 
\begin{lstlisting}
\tikzstyle{every axis legend}+=[
		at={(1.02,1)},
		anchor=north west]
\end{lstlisting}
draws the legend OUTSIDE TOP RIGHT.

\item
\begin{lstlisting}
\tikzstyle{every axis legend}+=[
		at={(1,0.5)},
		anchor=east,outer sep=0.5cm]
\end{lstlisting}
draws the legend INSIDE MIDDLE RIGHT, separated by 0.5cm from the axis.
\end{itemize}

\noindent
The default is
\begin{lstlisting}
\tikzstyle{every axis legend}=[%
		anchor=north east,%
		shape=rectangle,%
		fill=white,%
		draw=black,
		at={(0.98,0.98)}
		]
\end{lstlisting}

\subsubsection{Legends Options}
\subsubsection*{textwidth=auto$|$none$|$DIMENSION}
Assigns a width to the legend. Choices are
\begin{description}
	\item[auto] Determines the width automatically;
	\item[none] does not perform any line breaking;
	\item[DIMENSION] uses a fixed width like \lstinline!2cm! for the (total) legend (including the small marker/line combination).
\end{description}
Default is ``\texttt{auto}''.

\subsubsection*{font=COMMANDS}
Changes the legend font. Examples:
\begin{itemize}
	\item \lstinline!font=\Huge!
	\item \lstinline!font={\Huge\bfseries}!
\end{itemize}
Please note that the \Tikz\ option ``\texttt{font}'' will also be used, so you can also say
\begin{lstlisting}
\tikzstyle{every axis legend}+=[font=\Huge]
\end{lstlisting}
to get the same effect. The difference is that I didn't figure out how to determine the legend's width without a legend option.


\subsection{\texttt{\textbackslash autoplotspeclist}}
Allows to specify a list of plot specifications which will be used for each \lstinline!\addplot!-command without explicit plot specification.

There are several possiblities to change it:
\begin{enumerate}
	\item Use one of the predefined lists,
\begin{lstlisting}
\listcopy\coloredplotspeclist\to\autoplotspeclist%
\listcopy\blackwhiteplotspeclist\to\autoplotspeclist%
\end{lstlisting}
	\item Define your own one,
\begin{lstlisting}
\listnew{\autoplotspeclist}{%
	blue,mark=*\\%
	red,mark=square\\%
	dashed,mark=o\\%
	loosely dotted,mark=+\\%
	brown!60!black,mark options={fill=brown!40},mark=otimes*\\%
}
\end{lstlisting}
	(This example list requires \lstinline!\usetikzlibrary{plotmarks}!).
\end{enumerate}
Please note that the `\lstinline!\\!' is required to separate each element. Please note that comment characters~`\%' are necessary if the elements are on different lines.

\subsection{\texttt{\textbackslash logtologten\{ARG\}}}
Expands to the result of $\texttt{ARG}/\log(10)$. You can also use
\begin{lstlisting}
\logtologtentomacro{9.5}{\result}
\end{lstlisting}
and \lstinline!\result! will be filled with the result.

\subsection{\texttt{\textbackslash logten}}
Expands to the constant $\log(10)$. Useful for logplots because $\log(10^i) = i\log(10)$.

\subsection{\texttt{\textbackslash prettyprintnumber\{NUM\}}}
Allows to generate pretty--printed output for the number \texttt{NUM}. Examples:
\begin{lstlisting}
\prettyprintnumber{1.0}

\prettyprintnumber{151.015341}

\prettyprintnumber{90.99999}
\end{lstlisting}
results in

\prettyprintnumber{1.0},

\prettyprintnumber{151.015341},

\prettyprintnumber{90.99999}.

It is used to display axis ticks. The default rounding precision is defined by
\begin{lstlisting}
\def\prettyprintnumberprecision{2}
\end{lstlisting}
and can be reconfigured if needed (the highest precision is~$5$ due to \TeX's restricted numerical capabilities).

\subsection{\texttt{\textbackslash axispreset\{key=value,key=value\}}}
Allows to define default options for any axis. For example,
\begin{lstlisting}
...
\axispreset{width=\textwidth}%
...
\begin{tikzpicture}
\begin{axis}
...
\end{axis}
\end{tikzpicture}
\end{lstlisting}
will produce a width of \lstinline!\textwidth! for any following axis. You can preset any of the \texttt{axis}-options described below.

\subsection{\texttt{\textbackslash legendpreset\{key=value,key=value\}}}
Allows to define default options for any legend (See \lstinline!\axispreset!, it works in the same way.).

\subsection{Axis options}
There are several required and even more optional arguments to modify axes. They are used like
\begin{lstlisting}
\begin{tikzpicture}
\begin{axis}[key=value,key2=value2]
...
\end{axis}
\end{tikzpicture}
\end{lstlisting}
The overall appeareance can be changed with
\begin{lstlisting}
\tikzstyle{every axis}=[line width=1pt]
\end{lstlisting}
for example.

\subsubsection*{\texttt{xmin=COORD}, \texttt{xmax=COORD}, \texttt{ymin=COORD}, \texttt{ymax=COORD}}
These options denote the axis limits, i.e. the lower left and the upper right corner. Some remarks
\begin{itemize}
	\item The axis limits determine the plotted range. Everything else will be clipped away.
	\item The width of every unit $x$-coordinate will be scaled such that the plot has width \lstinline!\axisdefaultwidth! (including the tick- and axis labels). The height of every unit $y$-coordinate will be scaled such that the plot has height \lstinline!\axisdefaultheight!.

	You can override this default behavior with the options \lstinline!width=DIMEN!, \lstinline!height=DIMEN!, \lstinline!x=DIMEN! and \lstinline!y=DIMEN!, see below.
	\item If one of \lstinline!xmin! or \lstinline!xmax! is missing, the $x$-interval will be determined automatically (see \lstinline!\addplot!). The same holds true if one of \lstinline!ymin! or \lstinline!ymax! is missing: in this case, the $y$-interval will be determined automatically.

	\item The option \lstinline!enlargelimits! will automatically increase the plotted range.
\end{itemize}

\subsubsection*{\texttt{xlabel=TEXT}, \texttt{ylabel=TEXT}}
Changes the axis labels to `\texttt{TEXT}' which is any \LaTeX\ text. Use `\lstinline!{TEXT}!' if you need grouping.

Labels are \Tikz-Nodes which are placed with
\begin{lstlisting}
\node 
	[style=every axis label,
	style=every axis x label]
\node 
	[style=every axis label,
	style=every axis y label] 
\end{lstlisting}
so you can reconfigure their position and appearance. As for legends, the coordinate \lstinline!(0,0)! denotes the lower left axis corner and \lstinline!(1,1)! the upper right. 

The default styles are
\begin{lstlisting}
\tikzstyle{every axis label}=[]
\tikzstyle{every axis x label}=[
	at={(0.5,0)},
	below,
	yshift=-15pt]
\tikzstyle{every axis y label}=[
	at={(0,0.5)},
	xshift=-35pt,
	rotate=90]
\end{lstlisting}

\subsubsection*{\texttt{title=TEXT}}
Adds a caption to the plot. This will place a \Tikz-Node with
\begin{lstlisting}
\node[style=every axis title] {TEXT};
\end{lstlisting}
to the current axis. An example is shown in figure~\ref{fig:titleexample}. The title is placed in the middle of the axis (the placing does not incorporate any axis descriptions). You can reconfigure the appearance and/or placing of the title for example with
\begin{lstlisting}
\tikzstyle{every axis title}+=[at={(0.75,1)}]
\end{lstlisting}
This will place the title at~75\% of the $x$-axis. The coordinate~$(0,0)$ is the lower left corner and~$(1,1)$ the upper right one.

Please note that using the \LaTeX\ floating figures together with \lstinline!\caption{TEXT}! may be more appropriate in many situation. However, `\texttt{title}' allows access to the axis' size without any axis descriptions which is useful if more than one plot needs a caption.
\begin{figure}
	\centering
	\begin{tikzpicture}
	\begin{loglogaxis}[
		width=0.48\textwidth,
		xlabel=Dof,ylabel=Error,
		title={$\mu=0.1$, $\sigma=0.2$}]

		\addplot plot coordinates {
			(5,		8.312e-02)
			(17,	2.547e-02)
			(49,	7.407e-03)
			(129,	2.102e-03)
			(321,	5.874e-04)
			(769,	1.623e-04)
			(1793,	4.442e-05)
			(4097,	1.207e-05)
			(9217,	3.261e-06)
		};
	\end{loglogaxis}
	\end{tikzpicture}%
	\hfill
	\begin{tikzpicture}
	\begin{loglogaxis}[
		width=0.48\textwidth,
		xlabel=Dof,ylabel=Error,
		title={$\mu=1$, $\sigma=\frac{1}{2}$}]

		\addplot[color=red,mark=*] plot coordinates {
			(7,		8.472e-02)
			(31,	3.044e-02)
			(111,	1.022e-02)
			(351,	3.303e-03)
			(1023,	1.039e-03)
			(2815,	3.196e-04)
			(7423,	9.658e-05)
			(18943,	2.873e-05)
			(47103,	8.437e-06)
		};
	\end{loglogaxis}
	\end{tikzpicture}

	\begin{lstlisting}
	\begin{tikzpicture}
	\begin{loglogaxis}[
		width=0.48\textwidth,
		xlabel=Dof,ylabel=Error,
		title={$\mu=0.1$, $\sigma=0.2$}]

		\addplot plot coordinates {
			(5,		8.312e-02)
			(17,	2.547e-02)
			...
			(4097,	1.207e-05)
			(9217,	3.261e-06)
		};
	\end{loglogaxis}
	\end{tikzpicture}%
	\hfill
	\begin{tikzpicture}
	\begin{loglogaxis}[
		width=0.48\textwidth,
		xlabel=Dof,ylabel=Error,
		title={$\mu=1$, $\sigma=\frac{1}{2}$}]

		\addplot[color=red,mark=*] plot coordinates {
			(7,		8.472e-02)
			(31,	3.044e-02)
			...
			(18943,	2.873e-05)
			(47103,	8.437e-06)
		};
	\end{loglogaxis}
	\end{tikzpicture}
	\end{lstlisting}
	\caption{An example for the `\texttt{title}' option. Some data points have not been listed, the `\texttt{...}' is not part of the plot.}
	\label{fig:titleexample}
\end{figure}


\subsubsection*{\texttt{xmode=normal$|$log}, \texttt{ymode=normal$|$log}}
Allows to choose between normal plots or logplots for each $x,y$-combination. Default is \lstinline!xmode=normal!, \lstinline!ymode=normal!.

\subsubsection*{\texttt{xtick=\{LIST\}}, \texttt{ytick=\{LIST\}}}
Assigns a list of \emph{Positions} where ticks shall be placed. The argument \texttt{LIST} will be used inside of a \lstinline!\foreach \x in {LIST}! statement, and \texttt{LIST} contains one of the following formats:
\begin{itemize}
	\item \lstinline!{0,1,2,5,8}! (a series of coordinates),
	\item \lstinline!{0,...,5}! (the same as \lstinline!{0,1,2,3,4,5}!),
	\item \lstinline!{0,2,...,10}! (the same as \lstinline!{0,2,4,6,8,10}!),
	\item \lstinline!{9,...,3.5}! (the same as \lstinline!{9, 8, 7, 6, 5, 4}!),
	\item See \cite[Section~34]{tikz} for a more detailed definition of the options.
\end{itemize}
For logplots, \PGFPlots\ will apply $\log(\cdot)$ to each element in `\texttt{LIST}'. 

\paragraph{Attention:} You can't use the `\texttt{...}' syntax if the elements are too large for \TeX! For example, `\texttt{xtick=1.5e5,2e7,3e8}' will work (because the elements are interpreted as strings, not as numbers), but `\texttt{xtick=1.5,3e5,...,1e10}' will fail because it involves real number arithmetics beyond \TeX's capacities.
\vspace*{0.3cm}

\noindent
The default choice for ticks in a normal plot is to place them at each integer. The default for logplots it to place ticks at each $10^i$ in the axis' range.

The tick appearance can be (re-)configured with
\begin{lstlisting}
\tikzstyle{every tick}=[very thin,gray]
\tikzstyle{every minor tick}=[]
\end{lstlisting}
This style commands can be used at any time. The tick line width can be configured with the \lstinline!axis!-options `\texttt{tickwidth}' and `\texttt{subtickwidth}'.

\subsubsection*{\texttt{xtickten=\{LIST\}}, \texttt{ytickten=\{LIST\}}}
These options allow to place ticks at selected positions $10^k, k \in \text{\texttt{LIST}}$. They are only used for logplots. The syntax for `\texttt{LIST}' is the same as above for `\texttt{xtick=LIST}' or `\texttt{ytick=LIST}'.

\subsubsection*{\texttt{xticklabel=\{TEXT\}}, \texttt{yticklabel=\{TEXT\}}}
Allows to change the \emph{text} assigned to each tick position (see options \texttt{xtick} and \texttt{ytick}). The argument `\texttt{TEXT}' can be any \LaTeX-text. The following commands are valid inside of \texttt{TEXT}:
\begin{description}
	\item[\textbackslash tick] The current element of option \lstinline!xtick! (or \lstinline!ytick!).
	\item[\textbackslash ticknum] The current tick number, starting with~0 (a counter).
\end{description}
The default argument is 
\begin{itemize}
	\item \lstinline!\axisdefaultticklabel! for normal plots and 
	\item \lstinline!\axisdefaultticklabellog! for logplots, see below.
\end{itemize}
(the same holds for \lstinline!yticklabel!). The defaults are set to
\begin{lstlisting}
\newcommand{\axisdefaultticklabel}[0]{%
	$\prettyprintnumber{\tick}$%
}

\newcommand{\axisdefaultticklabellog}[0]{{%
	\logtologtentomacro{\tick}{\roundedtick}%
	$10^{\prettyprintnumber{\roundedtick}}$%
}}
\end{lstlisting}
You can change the appearance of tick labels with
\begin{lstlisting}
\tikzstyle{every tick label}=[]
\end{lstlisting}
and/or
\begin{lstlisting}
\tikzstyle{every x tick label}=[]
\end{lstlisting}
and
\begin{lstlisting}
\tikzstyle{every y tick label}=[]
\end{lstlisting}

\subsubsection*{\texttt{tickpos=left$|$right$|$both}}
Allows to choose where to place the small tick lines. Default is ``\texttt{both}''. This setting applies to both $x$~and~$y$ axis where ``left'' and ``right'' mean ``bottom'' and ``top'' for~$y$.

\subsubsection*{\texttt{xminorticks=true$|$false}, \texttt{yminorticks=true$|$false}}
Enables/disables the small minor tick lines. They are only used in log plots. Please note that minor ticks are automatically disabled if \texttt{xtick} is not a uniform range\footnote{A uniform list means the difference between all elements is~$1$ for normal plots or, for logplots, $\log(10)$.}. Default is \texttt{true}.

\subsubsection*{\texttt{tickwidth=DIMEN}, \texttt{subtickwidth=DIMEN}}
Allows to configure the width of the small tick lines. Sub ticks are only displayed for logarithmic plots.

\subsubsection*{\texttt{enlargelimits}}
Enlarges the axis size somewhat.

You can set \texttt{xmin}, \texttt{xmax} and \texttt{ymin}, \texttt{ymax} to the minimum/maximum values of your data and \texttt{enlargelimits} will enlarge the canvas such that the axis doesn't touch the plots.

Default is \lstinline!true! if axis limits are determined automatically and \lstinline!false! if you provide them manually.

\subsubsection*{\texttt{disablelogfilter}}
Disables numerical evaluation of $\log(x)$ in \LaTeX. If you specify this option, any plot coordinates and tick positions must be provided as $\log(x)$ instead of $x$. This may be faster and -- possibly -- more accurate than the numerical log. The current implementation of $\log(x)$ normalizes~$x$ to $m\cdot 10^e$ and computes
\[ \log(x) = \log(m) + e \log(10) \]
where $y = \log(m)$ is computed with a newton method applied to $\exp(y) - m$. The normalization involves string parsing without \TeX-registers. You can savely evaluate $\log(1\cdot 10^{-7})$ although \TeX-registers would produce an underflow for such small numbers. 

The exponential function is implemented in pgf using a truncated Euler McLaurin--series.

The current implementation of $\log(\cdot)$ is done by the macro \lstinline!\pgfmathlog! which is provided by package \lstinline!pgfmathlog.sty! (contained in the \PGFPlots-bundle).

\subsubsection*{\texttt{width=DIMEN}, \texttt{height=DIMEN}}
The axis is always scaled such that its dimension is 

{\centering\lstinline!(\axisdefaultwidth,\axisdefaultheight)!.

}%
\noindent
The options \lstinline!width=DIMEN! and \lstinline!height=DIMEN! override the default scaling. If just one of them is specified, the other one is scaled such that the aspect ratio stays the same.

\noindent\underline{Remarks:} 
\begin{itemize}
	\item The scaling only affects the width of one unit in $x$-direction or the height for one unit in $y$-direction. Axis labels and tick labels won't be resized.

	\item You can use the \Tikz-\lstinline!scale=NUMBER! option,
	\begin{lstlisting}
		\begin{tikzpicture}[scale=2]
		\begin{axis}
		...
		\end{axis}
		\end{tikzpicture}
	\end{lstlisting}
	to scale the complete picture.

	\item The \Tikz-options \lstinline!x! and \lstinline!y! which set the unit dimensions in $x$ and $y$ directions can be specified as arguments to \lstinline!\begin{axis}[x=1.5cm,y=2cm]! if needed (see below). These settings override the \lstinline!width! and \lstinline!height! options.

	\item Use
	\begin{lstlisting}
		\renewcommand{\axisdefaultwidth}{3cm}
		\renewcommand{\axisdefaultheight}{6cm}
		\begin{axis}
		...
		\end{axis}
	\end{lstlisting}
	to replace the default dimension.

	\item Please note that up to the writing of this manual, \PGFPlots\ only estimates the size needed for axis- and tick labels. It does not include legends which have been placed outside of the axis\footnote{I.e. the `\texttt{width}' option will not work as expected, but the bounding box is still ok.}. This may be fixed in future versions.

	Use the \lstinline!x=DIMEN! and \lstinline!y=DIMEN! options if the scaling happens to be wrong.
\end{itemize}


\subsubsection*{\texttt{x=DIMEN}, \texttt{y=DIMEN}}
Use
	\begin{lstlisting}
		\begin{tikzpicture}
		\begin{axis}[x=1.5cm,...]
		...
		\end{axis}
		\end{tikzpicture}
	\end{lstlisting}
	to set the unit size for one $x$-coordinate to 1.5cm. The same is possible for the $y$-coordinate.

	Setting $x$ explicitly overrides the \lstinline!width! option. Setting $y$ explicitly overrides the \lstinline!height! option.

	Please note that it is \emph{not} possible to specify \lstinline!x! as argument to \lstinline!tikzpicture!. The option 
	\begin{lstlisting}
		\begin{tikzpicture}[x=1.5cm]
		\begin{axis}
			...
		\end{axis}
		\end{tikzpicture}
	\end{lstlisting}
	won't have any effect because an axis is always scale to the final size 
	
	{\centering\lstinline!(\axisdefaultwidth,\axisdefaultheight)!
	
	}%
	\noindent
	(see the \lstinline!width! option).

\subsubsection*{\texttt{xfilter=CMD}, \texttt{yfilter=CMD}}
These options allow coordinate filtering. A coordinate filter maps an input coordinate to an output coordinate (or discards it completely).

Coordinate filters are useful in automatic processing system, where \PGFPlots\ is used to display automatically generated plots. You may not want to filter your coordinates by hand, so these options provide a tool to do this automatically.

Be warned: `\texttt{xfilter}' and `\texttt{yfilter}' are advanced options and may require advanced knowledge about \TeX.

They are used as in the following example. The code
\begin{lstlisting}
\def\myOwnXfilter#1\to#2{%
	\def#2{0.5}%
}%
\begin{tikzpicture}
\begin{axis}[xfilter={\myOwnXfilter}]
\addplot plot coordinates {
	(4,0)
	(6,1)
};
\end{axis}
\end{tikzpicture}
\end{lstlisting}
will result in
\begin{center}
{%
\def\myOwnXfilter#1\to#2{%
	\def#2{0.5}%
}%
\begin{tikzpicture}
\begin{axis}[xfilter={\myOwnXfilter}]
\addplot plot coordinates {
	(4,0)
	(6,1)
};
\end{axis}
\end{tikzpicture}
}%
\end{center}
because all $x$-coordinates are replaced by~$0.5$.

The Argument `\texttt{CMD}' is the name of a \TeX-macro which takes exactly two arguments which are separated by the string `\texttt{\string\to}'. Such a macro is defined as
\begin{lstlisting}
\def\exampleFilter#1\to#2{%
	\def#2{#1}%
}%
\end{lstlisting}
This example uses the \TeX-command \lstinline!\def! to define variables and commands. The arguments are used as follows:
\begin{itemize}
	\item \PGFPlots\ invokes the filter with argument \texttt{\#1} set to the input coordinate. For $x$-filters, this is the $x$-coordinate as it is specified to \lstinline!\addplot!, for $y$-filters it is the $y$-coordinate.
	\item If the corresponding axis is logarithmic, \texttt{\#1} is the \emph{logarithm} of the coordinate as a real number, for example \texttt{\#1=4.2341}.
	\item Argument \texttt{\#2} is the name of a \TeX\ command. The filter should assign this command. The first filter above assigned the constant~$0.5$ and the second filter did not filter anything because it is the identity.

	The replacement text of \texttt{\#2} is expected to be \emph{either} empty \emph{or} a real number (without any length-suffix like `cm' or `pt'). If it is empty, the coordinate won't be drawn at all, it will be thrown away.
\end{itemize}

\subsection{\texttt{execute at begin plot=COMMANDS}}
This axis option allows to invoke `\texttt{COMMANDS}' at the beginning of each \lstinline!\addplot! command. The argument `\texttt{COMMANDS}' can be any \LaTeX\ content.

You may use this in conjunction with \texttt{xfilter=...} to reset any counters or whatever. An example would be to change every 4th coordinate.

\subsection{\texttt{execute at end plot=COMMANDS}}
This axis option allows to invoke `\texttt{COMMANDS}' after each \lstinline!\addplot! command. The argument `\texttt{COMMANDS}' can be any \LaTeX\ content.