PGFPlots - A LaTeX Package to create normal/logarithmic plots in two and three dimensions.
Create normal/logarithmic plots in two and three dimensions for LaTeX/TeX/ConTeXt
PGFPlots draws high--quality function plots in normal or logarithmic scaling
with a user-friendly interface directly in TeX. The user supplies axis labels,
legend entries and the plot coordinates for one or more plots and PGFPlots
applies axis scaling, computes any logarithms and axis ticks and draws the
plots. It supports line plots, scatter plots, piecewise constant plots, bar
plots, area plots, mesh-- and surface plots, patch plots, contour plots, quiver
plots, histogram plots, polar axes, ternary diagrams, smith charts and some
more.
It has been developed as a spare time project by
Christian Feuersänger.
Pgfplots is based on
PGF/TikZ
PGFPlots package provides tools to generate plots and labeled axes easily. It draws normal plots, logplots and
semi-logplots, in two and three dimensions. Axis ticks, labels, legends (in case of multiple plots) can be
added with key-value options. It can cycle through a set of predefined line/marker/color specifications. In
summary, its purpose is to simplify the generation of high-quality function and/or data plots, and solving
the problems of
-
consistency of document and font type and font size,
-
direct use of TEX math mode in axis descriptions,
-
consistency of data and figures (no third party tool necessary),
-
inter document consistency using preamble configurations and styles.
Although not necessary, separate .pdf or .eps graphics can be generated using the external library developed as part of TikZ.
You are invited to use pgfplots for visualization of medium sized data sets in two- and three dimensions.
Sample images
More samples can be found in the manual or at the bottom of this page.
Download and Installation
PGFPlots is freely available and might already be part of your LaTeX Distribution.
If not, download it from
and follow the instructions in the pgfplots.pdf manual.
Downloads
Stable Versions
Please refer to
http://sourceforge.net/projects/pgfplots/ for download information and latest stable releases.
Version 1.5.1 has been released!
TeX Programming Notes
There is also a short document which encapsulates technical details about the lowlevel usage of TeX (especially expansion control).
It can be found at
TeX-programming-notes.pdf.
Testing Builds
Currently, no testing builds are available (at least none which are more recent than the most recent stable).
Unstable Builds
We provide
unstable builds here. They contain the most recent features, including those which are not yet ready for testing.
Installation instructions can be found in the manual (pdf). This version may require a recent PGF Unstable Build. Perhaps it works with the actual PGF stable. There is no warranty.
USE THESE FILES AT YOUR OWN RISK ONLY
| 2011-12-29 Revision 1.5-162-g7e8d100
|
| Unstable TDS release (.tds.zip) |
| Unstable TDS release PGFPlots Manual (.pdf) |
| Unstable TDS release PGFPlotstable Manual (.pdf) |
| Unstable TDS ChangeLog |
HISTORY:
1.5.1:
- more operations for FPU library (==, !=,<=,>=,?)
- fixed bug in usage of decorations in \addplot
- bugfix for contour prepared format=matlab
- added 'const plot mark mid' and 'jump mark mid' plot handlers
- nodes on a plot (\addplot ... node[pos=] {};)
- 'trim axis group left' and 'trim axis group right'
- bugfixes for polar axes and log+stacked plots
- added style 'log ticks with fixed point'
- introduced patched tikz paths to simplify circles and ellipses within an axis
- patchplots lib: patch type=polygon
- some more bugfixes
1.5:
- Contour plots,
- Histograms,
- Quiver plots,
- patch plots (library)
- Triangle Meshes
- Bilinear Elements
- Quadratic Triangles
- Biquadratic Quadrilaterals
- Coons Patches
- Discrete colorbars,
- Table sorting,
- Linear regression,
- Ternary diagrams,
- Tieline Plots
- Smith Charts
- Polar axes,
- Empty lines in input files result in interrupted plots,
- PDF user defined coordinate mouse popups
- CMYK colormaps and shadings,
- new markers and cycle lists
- access to axis limits,
- \addplot3 graphics: pgfplots draws an appropriate axis for a three-dimensional(!) external png graphics
- 3D axes: support to provide explicit unit vectors:
- explicit unit vectors
- explicit unit vectors which are uniformly rescaled to match width/height
- 3D axes: improved support for unit vector ratios
- improvements of the groupplot styles
- preliminary support for (2d) bar plots in 3d axes
- new shader 'faceted interp'
- table package:
- 'every nth row' style
- 'comment chars' key to define comment characters in input files
- 'skip first n' style
- lots of smaller bugfixes (see ChangeLog for details)
1.4.1:
- improved compatibility to gnuplot 4.4
1.4:
Version 1.4 contains several new features, mostly work on details.
It fixes many bugs and provides the following improvements:
- detached legends
- detached colorbars
- ybar (and similar plots) can now be mixed with other plot types
like line plots.
- improved legend formatting
- added 'restrict x to domain*' which cups coordinates outside of a specified domain (same for y and z)
- Added support for linear regression
- Inline tables,
- Lots of bug fixes
The next version will make a greater step when it is stable.
1.3.1:
Version 1.3.1 is a bugfix release containing
- improved parametric plots with gnuplot
- improved normalsize, small and footnotesize scale styles and added tiny
- a lot of bugfixes
1.3:
- improvements for two dimensional visualization, among them
- axis equal,
- color bars,
- nodes near coords,
- jumps in plots,
- improved description positioning,
- reverseable axis directions,
- simpler alignment of adjacent axes,
- units and a simplified user interface,
- new three dimensional line, scatter, mesh and surface plots,
- a copy of the automatic pdf externalization library,
- an improved manual enhanced with a lot of pdf cross references.
1.2.2:
- fixed a problem with the samples key,
- provides some smaller fixes and some manual improvements.
- added plot graphics.
1.2:
- completely rewritten math expression parser with extended data range,
- colormaps for scatter plots
- fine tuning for plot parameters.
- table package has been extended and is now a fully featured table typesetting, computing and postprocessing tool.
|
Troubleshooting
The
manual contains hints for troubleshooting.
Also see the
Support Section on sourceforge for how to report bugs or get help at the mailing list.
Related stuff
Support This Project
An introduction into key-value methods (including pgfkeys)
Implementing keyval input: an introduction by Joseph Wright and Christian Feuersänger [
keyval.pdf]
PGFPlots Gallery
The following graphics have been generated with the LaTeX Packages PGFPlots and PGFPlotsTable.

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=Cost,
ylabel=Error]
\addplot[color=red,mark=x] coordinates {
(2,-2.8559703)
(3,-3.5301677)
(4,-4.3050655)
(5,-5.1413136)
(6,-6.0322865)
(7,-6.9675052)
(8,-7.9377747)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel={$f(x) = x^2 - x +4$}
]
% use TeX as calculator:
\addplot {x^2 - x +4};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$\sin(x)$
]
% invoke external gnuplot as
% calculator:
\addplot gnuplot[id=sin]{sin(x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
height=9cm,
width=9cm,
grid=major,
]
\addplot gnuplot[id=filesuffix]{(-x**5 - 242)};
\addlegendentry{model}
\addplot coordinates {
(-4.77778,2027.60977)
(-3.55556,347.84069)
(-2.33333,22.58953)
(-1.11111,-493.50066)
(0.11111,46.66082)
(1.33333,-205.56286)
(2.55556,-341.40638)
(3.77778,-1169.24780)
(5.00000,-3269.56775)
};
\addlegendentry{estimate}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[xlabel=Cost,ylabel=Gain]
\addplot[color=red,mark=x] coordinates {
(10,100)
(20,150)
(40,225)
(80,340)
(160,510)
(320,765)
(640,1150)
};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel=Cost,
ylabel=Error]
\addplot[color=red,mark=x] coordinates {
(5, 8.31160034e-02)
(17, 2.54685628e-02)
(49, 7.40715288e-03)
(129, 2.10192154e-03)
(321, 5.87352989e-04)
(769, 1.62269942e-04)
(1793, 4.44248889e-05)
(4097, 1.20714122e-05)
(9217, 3.26101452e-06)
};
\addplot[color=blue,mark=*]
table[x=Cost,y=Error] {pgfplots.testtable};
\legend{Case 1,Case 2}
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}[
xlabel=Index,ylabel=Value]
\addplot[color=blue,mark=*] coordinates {
(1,8)
(2,16)
(3,32)
(4,64)
(5,128)
(6,256)
(7,512)
};
\end{semilogyaxis}%
\end{tikzpicture}%

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel={Degrees of freedom},
ylabel={$L_2$ Error}
]
\addplot 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)
};
\addplot 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)
};
\addplot coordinates{
(9,7.881e-02) (49,3.243e-02) (209,1.232e-02)
(769,4.454e-03) (2561,1.551e-03) (7937,5.236e-04)
(23297,1.723e-04) (65537,5.545e-05) (178177,1.751e-05)
};
\addplot coordinates{
(11,6.887e-02) (71,3.177e-02) (351,1.341e-02)
(1471,5.334e-03) (5503,2.027e-03) (18943,7.415e-04)
(61183,2.628e-04) (187903,9.063e-05) (553983,3.053e-05)
};
\addplot coordinates{
(13,5.755e-02) (97,2.925e-02) (545,1.351e-02)
(2561,5.842e-03) (10625,2.397e-03) (40193,9.414e-04)
(141569,3.564e-04) (471041,1.308e-04) (1496065,4.670e-05)
};
\legend{$d=2$,$d=3$,$d=4$,$d=5$,$d=6$}
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
% Example using groupplots library
\begin{tikzpicture}
\begin{groupplot}[group style={group size=2 by 2},height=3cm,width=3cm]
\nextgroupplot
\addplot coordinates {(0,0) (1,1) (2,2)};
\nextgroupplot
\addplot coordinates {(0,2) (1,1) (2,0)};
\nextgroupplot
\addplot coordinates {(0,2) (1,1) (2,1)};
\nextgroupplot
\addplot coordinates {(0,2) (1,1) (1,0)};
\end{groupplot}
\end{tikzpicture}
% Same example created as done without the library
\begin{tikzpicture}
\begin{axis}[name=plot1,height=3cm,width=3cm]
\addplot coordinates {(0,0) (1,1) (2,2)};
\end{axis}
\begin{axis}[name=plot2,at={($(plot1.east)+(1cm,0)$)},anchor=west,height=3cm,width=3cm]
\addplot coordinates {(0,2) (1,1) (2,0)};
\end{axis}
\begin{axis}[name=plot3,at={($(plot1.south)-(0,1cm)$)},anchor=north,height=3cm,width=3cm]
\addplot coordinates {(0,2) (1,1) (2,1)};
\end{axis}
\begin{axis}[name=plot4,at={($(plot2.south)-(0,1cm)$)},anchor=north,height=3cm,width=3cm]
\addplot coordinates {(0,2) (1,1) (1,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{groupplot}[group style={group size=3 by 1},xmin=0,ymin=0,height=4cm,width=5cm,no markers]
\nextgroupplot
\addplot[very thick] file {plotdata/group-1.dat};
\draw[red,dashed,thick] (axis cs:0,0) rectangle (axis cs:5,30);
\nextgroupplot[xmax=5,ymax=30]
\addplot[very thick] file {plotdata/group-1.dat};
\draw[red,dashed,thick] (axis cs:3,10) rectangle (axis cs:5,25);
\nextgroupplot[xmin=3,xmax=5,ymin=10,ymax=25]
\addplot[very thick] file {plotdata/group-1.dat};
\end{groupplot}
\draw[thick,blue,->,shorten >=2pt,shorten <=2pt]
(group c1r1.east) -- (group c2r1.west);
\draw[thick,blue,->,shorten >=2pt,shorten <=2pt]
(group c2r1.east) -- (group c3r1.west);
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[use units,
x unit=m,x unit prefix=k,
y unit=N,y unit prefix=m,
xlabel=Distance,ylabel=Force]
\addplot coordinates {
(1,2.3)
(2,2.7)
(3,2.1)
(4,1.8)
(5,1.5)
(6,1.1)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[change x base,
x SI prefix=kilo,x unit=m,
y SI prefix=milli,y unit=N,
xlabel=Distance,ylabel=Force]
\addplot coordinates {
(1000,1)
(2000,1.1)
(3000,1.2)
(4000,1.3)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[sharp plot] coordinates
{(0,0) (1,2) (2,3)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[smooth] coordinates
{(0,0) (1,2) (2,3)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[const plot]
coordinates
{(0,0.1) (0.1,0.15) (0.2,0.5) (0.3,0.62)
(0.4,0.56) (0.5,0.58) (0.6,0.65) (0.7,0.6)
(0.8,0.58) (0.9,0.55) (1,0.52)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[ymin=0,ymax=1,enlargelimits=false]
\addplot
[const plot,fill=blue,draw=black]
coordinates
{(0,0.1) (0.1,0.15) (0.2,0.5) (0.3,0.62)
(0.4,0.56) (0.5,0.58) (0.6,0.65) (0.7,0.6)
(0.8,0.58) (0.9,0.55) (1,0.52)}
\closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[const plot mark right]
coordinates
{(0,0.1) (0.1,0.15) (0.2,0.5) (0.3,0.62)
(0.4,0.56) (0.5,0.58) (0.6,0.65) (0.7,0.6)
(0.8,0.58) (0.9,0.55) (1,0.52)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[samples=8]
\addplot+[jump mark left,domain=-5:0]
{4*x^2 - 5};
\addplot+[jump mark right,domain=-5:0]
{0.7*x^3 + 50};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[xbar] coordinates
{(4,0) (1,1) (2,2)
(5,3) (6,4) (1,5)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[xbar,enlargelimits=0.15]
\addplot
[draw=blue,pattern=horizontal lines light blue]
coordinates
{(10,5) (15,10) (5,15) (24,20) (30,25)};
\addplot
[draw=black,pattern=horizontal lines dark blue]
coordinates
{(3,5) (5,10) (15,15) (20,20) (35,25)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[ybar] plot coordinates
{(0,3) (1,2) (2,4) (3,1) (4,2)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Population,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ybar,
bar width=7pt,
]
\addplot
coordinates {(1930,50e6) (1940,33e6)
(1950,40e6) (1960,50e6) (1970,70e6)};
\addplot
coordinates {(1930,38e6) (1940,42e6)
(1950,43e6) (1960,45e6) (1970,65e6)};
\addplot
coordinates {(1930,15e6) (1940,12e6)
(1950,13e6) (1960,25e6) (1970,35e6)};
\legend{Far,Near,Here}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Population,
enlargelimits=0.15,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ybar=5pt,% configures `bar shift'
bar width=9pt,
nodes near coords,
point meta=y *10^-7 % the displayed number
]
\addplot
coordinates {(1930,50e6) (1940,33e6)
(1950,40e6) (1960,50e6) (1970,70e6)};
\addplot
coordinates {(1930,38e6) (1940,42e6)
(1950,43e6) (1960,45e6) (1970,65e6)};
\legend{Far,Near}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[ybar interval] plot coordinates
{(0,2) (0.1,1) (0.3,0.5) (0.35,4) (0.5,3)
(0.6,2) (0.7,1.5) (1,1.5)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[ybar interval,
xtick=data,
xticklabel interval boundaries,
x tick label style=
{rotate=90,anchor=east}
]
\addplot coordinates
{(0,2) (0.1,1) (0.3,0.5) (0.35,4) (0.5,3)
(0.6,2) (0.7,1.5) (1,1.5)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
x tick label style={
/pgf/number format/1000 sep=},
ylabel=Population,
enlargelimits=0.05,
legend style={at={(0.5,-0.15)},
anchor=north,legend columns=-1},
ybar interval=0.7,
]
\addplot
coordinates {(1930,50e6) (1940,33e6)
(1950,40e6) (1960,50e6) (1970,70e6)};
\addplot
coordinates {(1930,38e6) (1940,42e6)
(1950,43e6) (1960,45e6) (1970,65e6)};
\addplot
coordinates {(1930,15e6) (1940,12e6)
(1950,13e6) (1960,25e6) (1970,35e6)};
\legend{Far,Near,Here}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=53,
ylabel=Age,
xlabel=Quantity,
enlargelimits=false,
ytick=data,
yticklabel interval boundaries,
xbar interval,
]
\addplot
coordinates {(10,5) (10.5,10) (15,13)
(24,18) (50,21) (23,25) (10,30)
(3,50) (3,70)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[xcomb] coordinates
{(4,0) (1,1) (2,2)
(5,3) (6,4) (1,5)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[ycomb] plot coordinates
{(0,3) (1,2) (2,4) (3,1) (4,2)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[stack plots=y]
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)};
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)};
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[stack plots=y,/tikz/ybar]
\addplot coordinates
{(0,1) (1,1) (2,3) (3,2) (4,1.5)};
\addplot coordinates
{(0,1) (1,1) (2,3) (3,2) (4,1.5)};
\addplot coordinates
{(0,1) (1,1) (2,3) (3,2) (4,1.5)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[ybar stacked]
\addplot coordinates
{(0,1) (1,1) (2,3) (3,2) (4,1.5)};
\addplot coordinates
{(0,1) (1,1) (2,3) (3,2) (4,1.5)};
\addplot coordinates
{(0,1) (1,1) (2,3) (3,2) (4,1.5)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[stack plots=x,/tikz/xbar]
\addplot coordinates
{(1,0) (2,1) (2,2) (3,3)};
\addplot coordinates
{(1,0) (2,1) (2,2) (3,3)};
\addplot coordinates
{(1,0) (2,1) (2,2) (3,3)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[xbar stacked]
\addplot coordinates
{(1,0) (2,1) (2,2) (3,3)};
\addplot coordinates
{(1,0) (2,1) (2,2) (3,3)};
\addplot coordinates
{(1,0) (2,1) (2,2) (3,3)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
stack plots=y,
area style,
enlarge x limits=false]
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
const plot,
stack plots=y,
area style,
enlarge x limits=false]
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
smooth,
stack plots=y,
area style,
enlarge x limits=false]
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\addplot coordinates
{(0,1) (1,1) (2,2) (3,2)}
\closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotstableread{pgfplots.timeseries.dat}\table
\pgfplotstabletypeset\table

[.tex]
[.pdf]
\pgfplotstableread
{pgfplots.timeseries.dat}
{\table}
\begin{tikzpicture}
\begin{axis}[
ymin=0,
minor tick num=4,
enlarge x limits=false,
axis on top,
every axis plot post/.append style=
{mark=none},
const plot,
legend style={
area legend,
at={(0.5,-0.15)},
anchor=north,
legend columns=-1}]
\addplot[draw=blue,fill=blue!30!white]
table[x=time,y=1minload] from \table
\closedcycle;
\addplot table[x=time,y=nodes] from \table;
\addplot table[x=time,y=cpus] from \table;
\addplot table[x=time,y=processes]
from \table;
\legend{1min load,nodes,cpus,processes}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotstableread{pgfplots.timeseries.dat}\table
\begin{tikzpicture}
\begin{axis}[
ymin=0,
minor tick num=4,
enlarge x limits=false,
const plot,
axis on top,
stack plots=y,
cycle list={%
{blue!70!black,fill=blue},%
{blue!60!white,fill=blue!30!white},%
{draw=none,fill={rgb:red,138;green,82;blue,232}},%
{red,thick}%
},
ylabel={Mem [GB]},
legend style={
area legend,
at={(0.5,-0.15)},
anchor=north,
legend columns=2}]
\addplot table[x=time,y=memused] from \table \closedcycle;
\addplot table[x=time,y=memcached] from \table \closedcycle;
\addplot table[x=time,y=membuf] from \table \closedcycle;
\addplot+[stack plots=false]
table[x=time,y=memtotal] from \table;
\legend{Memory used,Memory cached,Memory buffered,Total memory}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[enlargelimits=false]
\addplot+[only marks,samples=400]
{rand};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[scatter,only marks,
samples=50,scatter src=y]
{x-x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[scatter,
samples=50,scatter src=y]
{x^3};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
% provide color data explicitly using []
% behind coordinates:
\addplot+[scatter,scatter src=explicit]
coordinates {
(0,0) [1.0e10]
(1,2) [1.1e10]
(2,3) [1.2e10]
(3,4) [1.3e10]
% ...
};
% Assumes a datafile.dat like
% xcolname ycolname colordata
% 0 0 0.001
% 1 2 0.3
% 2 2.1 0.4
% 3 3 0.5
% ...
% the file may have more columns.
\addplot+[scatter,scatter src=explicit]
table[x=xcolname,y=ycolname,meta=colordata]
{datafile.dat};
% Same data as last example:
\addplot+[scatter,scatter src=\thisrow{colordata}+\thisrow{ycolname}]
table[x=xcolname,y=ycolname]
{datafile.dat};
% Assumes a datafile.dat like
% 0 0 0.001
% 1 2 0.3
% 2 2.1 0.4
% 3 3 0.5
% ...
% the first three columns will be used here:
\addplot+[scatter,scatter src=explicit]
file {datafile.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[title=Default arguments]
\addplot+[scatter,scatter src=y]
{2*x+3};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=Black fill color and varying draw color,
scatter/use mapped color=
{draw=mapped color,fill=black}]
\addplot+[scatter,scatter src=y]
{2*x+3};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=Black draw color and varying fill color,
scatter/use mapped color=
{draw=black,fill=mapped color}]
\addplot+[scatter,scatter src=y]
{2*x+3};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[scatter/classes={
a={mark=square*,blue},%
b={mark=triangle*,red},%
c={mark=o,draw=black}}]
% \addplot[] is better than \addplot+[] here:
% it avoids scalings of the cycle list
\addplot[scatter,only marks,
scatter src=explicit symbolic]
coordinates {
(0.1,0.15) [a]
(0.45,0.27) [c]
(0.02,0.17) [a]
(0.06,0.1) [a]
(0.9,0.5) [b]
(0.5,0.3) [c]
(0.85,0.52) [b]
(0.12,0.05) [a]
(0.73,0.45) [b]
(0.53,0.25) [c]
(0.76,0.5) [b]
(0.55,0.32) [c]
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=south east]
% The data file contains:
% x y label
% 0.1 0.15 a
% 0.45 0.27 c
% 0.02 0.17 a
% 0.06 0.1 a
% 0.9 0.5 b
% 0.5 0.3 c
% 0.85 0.52 b
% 0.12 0.05 a
% 0.73 0.45 b
% 0.53 0.25 c
% 0.76 0.5 b
% 0.55 0.32 c
\addplot[
scatter/classes={
a={mark=square*,blue},%
b={mark=triangle*,red},%
c={mark=o,draw=black,fill=black}%
},
scatter,only marks,
scatter src=explicit symbolic]
table[x=x,y=y,meta=label]
{plotdata/scattercl.dat};
\addplot coordinates
{(0.1,0.1) (0.5,0.3) (0.85,0.5)};
\legend{Class 1,Class 2,Class 3,Line}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[nodes near coords]
\addplot+[only marks] coordinates {
(0.5,0.2) (0.2,0.1) (0.7,0.6)
(0.35,0.4) (0.65,0.1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[nodes near coords,enlargelimits=0.2]
\addplot+[only marks,
point meta=explicit symbolic]
coordinates {
(0.5,0.2) [(1)]
(0.2,0.1) [(2)]
(0.7,0.6) [(3)]
(0.35,0.4) [(4)]
(0.65,0.1) [(5)]
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
% Low-Level scatter plot interface Example:
% use three different marker classes
% 0% - 30% : first class
% 30% - 60% : second class
% 60% - 100% : third class
\begin{axis}[
scatter/@pre marker code/.code={%
\ifdim\pgfplotspointmetatransformed pt<300pt
\def\markopts{mark=square*,fill=blue}%
\else
\ifdim\pgfplotspointmetatransformed pt<600pt
\def\markopts{mark=triangle*,fill=orange}%
\else
\def\markopts{mark=pentagon*,fill=red}%
\fi
\fi
\expandafter\scope\expandafter[\markopts]
},%
scatter/@post marker code/.code={%
\endscope
}]
\addplot+[scatter,scatter src=y,
samples=40]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot[mesh] {x+sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot[mesh,point meta=explicit]
coordinates {
(0,0) [0]
(1,0.1) [1]
(2,0.1) [2]
(3,0.3) [3]
(4,0.3) [4]
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=Discarding unbounded coords,
unbounded coords=discard]
\addplot coordinates {
(0,0) (10,50) (20,100) (30,200)
(40,inf) (50,600) (60,800) (80,1000)
};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
title=Jumps at unbounded coords,
unbounded coords=jump]
\addplot coordinates {
(0,0) (10,50) (20,100) (30,200)
(40,inf) (50,600) (60,800) (80,1000)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
unbounded coords=jump,
% A technical filter to cut out
% the x<0 and y<0 edge.
filter point/.code={%
\pgfmathparse
{\pgfkeysvalueof{/data point/x}<0}%
\ifpgfmathfloatcomparison
\pgfmathparse
{\pgfkeysvalueof{/data point/y}<0}%
\ifpgfmathfloatcomparison
\pgfkeyssetvalue{/data point/x}{nan}%
\fi
\fi
},
]
\addplot3[surf] {exp(-sqrt(x^2 + y^2))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={0}{0},
xlabel=$x$,
zlabel=$z$,
title=View along the positive $y$ axis]
\addplot3[surf] {x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={0}{90},
xlabel=$x$,
ylabel=$y$,
title=View from top]
\addplot3[surf] {x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={-45}{45},
xlabel=$x$,ylabel=$y$,zlabel=$z$]
\addplot3[surf] {x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view/h=-30]
\addplot3[
surf,
%shader=interp,
shader=flat,
samples=50,
domain=-3:3,y domain=-2:2]
{sin(deg(x+y^2))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view/h=10]
\addplot3[
surf,
%shader=interp,
shader=flat,
samples=50,
domain=-3:3,y domain=-2:2]
{sin(deg(x+y^2))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view/h=40,colormap/violet]
\addplot3[
surf,
%shader=interp,
shader=flat,
samples=50,
domain=-3:3,y domain=-2:2]
{sin(deg(x+y^2))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view/h=70]
\addplot3[
surf,
%shader=interp,
shader=flat,
samples=50,
domain=-3:3,y domain=-2:2]
{sin(deg(x+y^2))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
view/h=60,
plot box ratio={1}{1}{1},
colormap={violet}{[1cm] rgb255(0cm)=(25,25,122)
color(1cm)=(white) rgb255(5cm)=(238,140,238)},
xlabel=$x$,
ylabel=$t$,
zlabel={$p(x,t)$},
shader=faceted,
title=Initial \texttt{plot box ratio},
]
\addplot3[surf,y domain=0.02:3.5,samples=81]
{1/(2*sqrt(pi*y)) * exp(0-x^2/y)};
% the '0' is a work-around for a bug in PGF 2.00
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
view/h=60,
plot box ratio={1}{2}{1},
colormap={violet}{[1cm] rgb255(0cm)=(25,25,122)
color(1cm)=(white) rgb255(5cm)=(238,140,238)},
xlabel=$x$,
ylabel=$t$,
zlabel={$p(x,t)$},
shader=flat,
title=\texttt{plot box ratio=1 2 1},
]
\addplot3[surf,y domain=0.02:3.5,samples=81]
{1/(2*sqrt(pi*y)) * exp(0-x^2/y)};
% the '0' is a work-around for a bug in PGF 2.00
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
3d box=background,
% pretty printing, but irrelevant:
title={3d box=background},
samples=5,
domain=-4:4,
xtick=data,
ytick=data,
]
\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
3d box,% same as 3d box=complete
% pretty printing, but irrelevant:
title={3d box=complete},
samples=5,
domain=-4:4,
xtick=data,
ytick=data,
]
\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
3d box=complete,
grid=major,
title={3d box=complete},
samples=5, domain=-4:4,
xtick=data, ytick=data,
]
\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}%
~
\begin{tikzpicture}
\begin{axis}[
3d box=complete*,
grid=major,
title={3d box=complete*},
samples=5, domain=-4:4,
xtick=data, ytick=data,
]
\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis lines=center,
axis on top,
samples=5, domain=-4:4,
xtick=data, ytick=data,
ztick=\empty, % no z ticks here
]
\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis lines*=left,
samples=5, domain=-4:4,
xtick=data, ytick=data,
]
\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis lines*=right,
samples=5, domain=-4:4,
xtick=data, ytick=data,
]
\addplot3[surf] {x*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
% this yields a 3x4 matrix:
\addplot3[surf] coordinates {
(0,0,0) (1,0,0) (2,0,0) (3,0,0)
(0,1,0) (1,1,0.6) (2,1,0.7) (3,1,0.5)
(0,2,0) (1,2,0.7) (2,2,0.8) (3,2,0.5)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
% We have `plotdata/first3d.dat' with
%---------
% 0 0 0.8
% 1 0 0.56
% 2 0 0.5
% 3 0 0.75
%
% 0 1 0.6
% 1 1 0.3
% 2 1 0.21
% 3 1 0.3
%
% 0 2 0.68
% 1 2 0.22
% 2 2 0.25
% 3 2 0.4
%
% 0 3 0.7
% 1 3 0.5
% 2 3 0.58
% 3 3 0.9
% -> yields a 4x4 matrix:
\addplot3[surf] file {plotdata/first3d.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
% this yields also a 3x4 matrix:
\addplot3[surf,mesh/rows=3] coordinates {
(0,0,0) (1,0,0) (2,0,0) (3,0,0)
(0,1,0) (1,1,0.6) (2,1,0.7) (3,1,0.5)
(0,2,0) (1,2,0.7) (2,2,0.8) (3,2,0.5)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[mesh/ordering=x varies]
% this yields a 3x4 matrix in `x varies'
% ordering:
\addplot3[surf] coordinates {
(0,0,0) (1,0,0) (2,0,0) (3,0,0)
(0,1,0) (1,1,0.6) (2,1,0.7) (3,1,0.5)
(0,2,0) (1,2,0.7) (2,2,0.8) (3,2,0.5)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[mesh/ordering=y varies]
% this yields a 3x4 matrix in colwise ordering:
\addplot3[surf] coordinates {
(0,0,0) (0,1,0) (0,2,0)
(1,0,0) (1,1,0.6) (1,2,0.7)
(2,0,0) (2,1,0.7) (2,2,0.8)
(3,0,0) (3,1,0.5) (3,2,0.5)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf] {y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar]
\addplot3
[surf,faceted color=blue,
samples=15,
domain=0:1,y domain=-1:1]
{x^2 - y^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[xlabel=$x$,ylabel=$y$]
\addplot3 coordinates {(0,0,0) (0,0.5,1) (0,1,0)};
\addplot3 coordinates {(0,1,0) (0.5,1,1) (1,1,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={60}{30}]
\addplot3+[domain=0:5*pi,samples=60,samples y=0]
({sin(deg(x))},
{cos(deg(x))},
{2*x/(5*pi)});
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$y$,
zlabel={$f(x,y) = x\cdot y$},
title=A Scatter Plot Example]
% `pgfplotsexample4_grid.dat' contains a
% large sequence of input points of the form
% x_0 x_1 f(x)
% 0 0 0
% 0 0.03125 0
% 0 0.0625 0
% 0 0.09375 0
% 0 0.125 0
% 0 0.15625 0
\addplot3+[only marks] table
{plotdata/pgfplotsexample4_grid.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$y$,
zlabel={$f(x,y) = x\cdot y$},
title=A Scatter Plot Example]
\addplot3+[only marks,scatter] table
{plotdata/pgfplotsexample4_grid.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
3d box,
zmax=1.4,
colorbar,
xlabel=$x$,
ylabel=$y$,
zlabel={$f(x,y) = x\cdot y$},
title={Using Coordinate Filters to fix $z=1.4$}]
% `pgfplotsexample4.dat' contains similar data as in
% `pgfplotsexample4_grid.dat', but it uses a uniform
% matrix structure (same number of points in every scanline).
\addplot3[surf,mesh/ordering=y varies]
table {plotdata/pgfplotsexample4.dat};
\addplot3[scatter,scatter src=\thisrow{f(x)},only marks, z filter/.code={\def\pgfmathresult{1.4}}]
table {plotdata/pgfplotsexample4_grid.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
view={120}{40},
width=220pt,
height=220pt,
grid=major,
z buffer=sort,
xmin=-1,xmax=9,
ymin=-1,ymax=9,
zmin=-1,zmax=9,
enlargelimits=upper,
xtick={-1,1,...,19},
ytick={-1,1,...,19},
ztick={-1,1,...,19},
xlabel={$l_1$},
ylabel={$l_2$},
zlabel={$l_3$},
point meta={x+y+z+3},
colormap={summap}{
color=(black); color=(blue);
color=(black); color=(white)
color=(orange) color=(violet)
color=(red)
},
scatter/use mapped color={
draw=mapped color,fill=mapped color!70},
]
% `pgfplots_scatter4.dat' contains a large sequence of
% the form
% l_0 l_1 l_2
% 1 6 -1
% -1 -1 -1
% 0 -1 -1
% -1 0 -1
% -1 -1 0
% 1 -1 -1
% 0 0 -1
% 0 -1 0
\addplot3[only marks,scatter,mark=cube*,mark size=7]
table {plotdata/pgfplots_scatterdata4.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[mesh] {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3+[mesh,scatter,samples=10,domain=0:1]
{x*(1-x)*y*(1-y)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[grid=major,view={210}{30}]
\addplot3+[mesh,scatter,samples=10,domain=0:1]
{5*x*sin(2*deg(x)) * y*(1-y)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view/az=14]
\addplot3[mesh,draw=red,samples=10] {x^2-y^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,shader=interp] {x*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
grid=major,
colormap/greenyellow]
\addplot3[surf,samples=30,domain=0:1]
{5*x*sin(2*deg(x)) * y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,faceted color=blue] {x+y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colormap/cool]
\addplot3[surf,samples=10,domain=0:1,
shader=interp]
{x*(1-x)*y*(1-y)};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[colormap/cool]
\addplot3[surf,samples=25,domain=0:1,
shader=flat]
{x*(1-x)*y*(1-y)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[grid=major]
\addplot3[surf,shader=interp,
samples=25,domain=0:2,y domain=0:1]
{exp(-x) * sin(pi*deg(y))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[grid=major]
\addplot3[surf,shader=faceted,
samples=25,domain=0:2,y domain=0:1]
{exp(-x) * sin(pi*deg(y))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,shader=flat,
samples=10,domain=0:1]
{x^2*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,shader=interp,
samples=10,domain=0:1]
{x^2*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,shader=faceted,
samples=10,domain=0:1]
{x^2*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,shader=flat,
draw=black,
samples=10,domain=0:1]
{x^2*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,shader=faceted,
scatter,mark=*,
samples=10,domain=0:1]
{x^2*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={60}{30}]
\addplot3+[domain=0:5*pi,samples=60,samples y=0]
({sin(deg(x))},
{cos(deg(x))},
{2*x/(5*pi)});
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={60}{30}]
\addplot3[mesh,z buffer=sort,
samples=20,domain=-1:0,y domain=0:2*pi]
({sqrt(1-x^2) * cos(deg(y))},
{sqrt( 1-x^2 ) * sin(deg(y))},
x);
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={60}{30}]
\addplot3[mesh,z buffer=sort,
scatter,only marks,scatter src=z,
samples=30,domain=-1:1,y domain=0:2*pi]
({sqrt(1-x^2) * cos(deg(y))},
{sqrt( 1-x^2 ) * sin(deg(y))},
x);
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={60}{30}]
\addplot3[surf,shader=flat,z buffer=sort,
samples=30,domain=-1:0,y domain=0:2*pi]
({sqrt(1-x^2) * cos(deg(y))},
{sqrt( 1-x^2 ) * sin(deg(y))},
x);
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotsset{domain=-1:1}
\begin{tikzpicture}
\begin{axis}[xlabel=A normal sized $x$ label]
\addplot[smooth,blue,mark=*] {x^2};
\end{axis}
\end{tikzpicture}%
\hspace{0.15cm}
\begin{tikzpicture}
\begin{axis}[xlabel={$\displaystyle \sum_{i=0}^N n_i $ }]
\addplot[smooth,blue,mark=*] {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotsset{domain=-1:1}
\begin{tikzpicture}[baseline]
\begin{axis}[xlabel=A normal sized $x$ label]
\addplot[smooth,blue,mark=*] {x^2};
\end{axis}
\end{tikzpicture}%
\hspace{0.15cm}
\begin{tikzpicture}[baseline]
\begin{axis}[xlabel={$\displaystyle \sum_{i=0}^N n_i $ }]
\addplot[smooth,blue,mark=*] {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\pgfplotsset{every axis/.append style={
cycle list={
{red,only marks,mark options={
fill=red,scale=0.8},mark=*},
{black,only marks,mark options={
fill=black,scale=0.8},mark=square*}}}}
\begin{axis}[width=4cm,scale only axis,
name=main plot]
\addplot file
{plotdata/pgfplots_scatterdata1.dat};
\addplot file
{plotdata/pgfplots_scatterdata2.dat};
\addplot[blue] coordinates {
(0.093947, -0.011481)
(0.101957, 0.494273)
(0.109967, 1.000027)};
\end{axis}
% introduce named coordinate:
\path (main plot.below south west) ++(0,-0.1cm)
coordinate (lower plot position);
\begin{axis}[at={(lower plot position)},
anchor=north west,
width=4cm,scale only axis,height=0.8cm,
ytick=\empty]
\addplot file
{plotdata/pgfplots_scatterdata1_latent.dat};
\addplot file
{plotdata/pgfplots_scatterdata2_latent.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}%
\begin{axis}[
title=A title,
ylabel style={overlay},
yticklabel style={overlay},
xlabel={$x$},
ylabel={$y$},
legend style={at={(0.5,0.97)},
anchor=north,legend columns=-1},
domain=-2:2
]
\addplot {x^2};
\addplot {x^3};
\addplot {x^4};
\legend{$x^2$,$x^3$,$x^4$}
\end{axis}
\end{tikzpicture}%

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
domain=0:6.2832,samples=200,
legend style={
overlay,
at={(-0.5,0.5)},
anchor=center},
every axis plot post/.append style={mark=none},
enlargelimits=false]
\addplot {sin(deg(x)+3)+rand*0.05};
\addplot {cos(deg(x)+2)+rand*0.05};
\legend{Signal 1,Signal 2}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\setlength{\fboxsep}{0pt}%
\fbox{%
\begin{tikzpicture}%
\begin{pgfinterruptboundingbox}
\begin{axis}[
name=my plot,
title=A title,
xlabel={$x$},
ylabel={$y$},
legend style={at={(0.5,0.97)},
anchor=north,legend columns=-1},
domain=-2:2
]
\addplot {x^2};
\addplot {x^3};
\addplot {x^4};
\legend{$x^2$,$x^3$,$x^4$}
\end{axis}
\end{pgfinterruptboundingbox}
\useasboundingbox
(my plot.below south west)
rectangle (my plot.above north east);
\end{tikzpicture}%
}%

[.tex]
[.pdf]
\begin{tikzpicture}
\matrix {
\begin{axis}
\addplot {x};
\end{axis}
&
% differently large labels are aligned automatically:
\begin{axis}[ylabel={$f(x)=x^2$},ylabel style={font=\Huge}]
\addplot {x^2};
\end{axis}
\\
%
\begin{axis}[xlabel=$x$,xlabel style={font=\Huge}]
\addplot {x^3};
\end{axis}
&
\begin{axis}
\addplot {x^4};
\end{axis}
\\
};
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[ymin=0,ymax=1,enlargelimits=false]
\addplot
[blue!80!black,fill=blue,fill opacity=0.5]
coordinates
{(0,0.1) (0.1,0.15) (0.2,0.5) (0.3,0.62)
(0.4,0.56) (0.5,0.58) (0.6,0.65) (0.7,0.6)
(0.8,0.58) (0.9,0.55) (1,0.52)}
|- (axis cs:0,0) -- cycle;
\addplot
[red,fill=red!90!black,opacity=0.5]
coordinates
{(0,0.25) (0.1,0.27) (0.2,0.24) (0.3,0.24)
(0.4,0.26) (0.5,0.3) (0.6,0.23) (0.7,0.2)
(0.8,0.15) (0.9,0.1) (1,0.1)}
|- (axis cs:0,0) -- cycle;
\addplot[green!20!black] coordinates
{(0,0.4) (0.2,0.75) (1,0.75)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[id=parable,domain=-5:5]
gnuplot{4*x**2 - 5}
node[pin=180:{$4x^2-5$}]{};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf,domain=0:360,samples=40]
{sin(x)*sin(y)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colormap/redyellow,colorbar]
\addplot3[surf,
domain=0:360,samples=40]
{sin(x)*sin(y)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[view={60}{30}]
\addplot3[surf,shader=flat,
samples=20,
domain=-1:0,y domain=0:2*pi,
z buffer=sort]
({sqrt(1-x^2) * cos(deg(y))},
{sqrt( 1-x^2 ) * sin(deg(y))},
x);
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}
\addplot coordinates {
(769, 1.6227e-04)
(1793, 4.4425e-05)
(4097, 1.2071e-05)
(9217, 3.2610e-06)
(2.2e5, 2.1E-6)
(1e6, 0.00003341)
(2.3e7, 0.00131415)
};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot {sin(deg(x))};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\addplot+[only marks] {sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot coordinates {
(0,0)
(0.5,1)
(1,2)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[error bars/.cd,x dir=both,x explicit]
coordinates {
(0,0) +- (0.1,0)
(0.5,1) +- (0.4,0.2)
(1,2)
(2,5) +- (1,0.1)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[scatter,scatter src=explicit] coordinates {
(900,1e-6) [1]
(2600,5e-7) [2]
(4000,7e-8) [3]
};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel=Dof,
ylabel=$L_2$ error]
\addplot table[x=dof,y=L2] {datafile.dat};
\end{loglogaxis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel=Dof,
ylabel=$L_infty$ error]
\addplot table[x=dof,y=Lmax] {datafile.dat};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot {x^2 + 4};
\addplot {-5*x^3 - x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[domain=0:360]
{sin(x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[domain=-pi:pi]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
title={$\frac{1}{x^2}$}]
\addplot[blue,domain=1:1e30]
{x^-2};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}[
title={$e^x$ logarithmically plotted}]
\addplot[blue,domain=1:700]
{exp(x)};
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotstabletypeset[columns={maxlevel,L2}]{plotdata/newexperiment1.dat}
\begin{tikzpicture}
\begin{semilogyaxis}[
xlabel=\texttt{maxlevel}$ + 10$
]
\addplot table
[x expr=\thisrow{maxlevel}+10, y=L2]
{plotdata/newexperiment1.dat};
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot
gnuplot[id=sin]{sin(x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}
\addplot gnuplot
[id=exp,domain=0:10]{exp(x)};
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot
shell[prefix=pgfshell_,id=cos]{awk 'BEGIN{
pi=3.14159; N=10;
for(i=0;i<=N;i++) print i,cos(i/N*pi);}'};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[prefix=pgfshell_,id=replot]
shell{cat pgfshell_cos.out};
% just reprint the result from above
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[enlargelimits=false,axis on top]
\addplot graphics
[xmin=-3,xmax=3,ymin=-3,ymax=3]
{external1};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[axis on top,title=Graphics Import]
\addplot graphics
[xmin=0,xmax=1,ymin=0,ymax=1,
% trim=left bottom right top
includegraphics={trim=12 9 12 8,clip}]
{external2};
\addplot coordinates {(0,0) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% [See the TikZ manual if you'd like to learn about nodes and pins]
\begin{tikzpicture}
\tikzset{
every pin/.style={fill=yellow!50!white,rectangle,rounded corners=3pt,font=\tiny},
small dot/.style={fill=black,circle,scale=0.3}
}
\begin{axis}[
clip=false,
title=How \texttt{axis description cs} works
]
\addplot {x};
\node[small dot,pin=120:{$(0,0)$}] at (axis description cs:0,0) {};
\node[small dot,pin=-30:{$(1,1)$}] at (axis description cs:1,1) {};
\node[small dot,pin=-90:{$(1.03,0.5)$}] at (axis description cs:1.03,0.5) {};
\node[small dot,pin=125:{$(0.5,0.5)$}] at (axis description cs:0.5,0.5) {};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
legend entries={$x$,$x^2$},
legend style={
at={(1.03,0.5)},
anchor=west
}
]
\addplot {x};
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% the same as above for 3D ...
% [See the TikZ manual if you'd like to learn about nodes and pins]
\begin{tikzpicture}
\tikzset{
every pin/.style={fill=yellow!50!white,rectangle,rounded corners=3pt,font=\tiny},
small dot/.style={fill=black,circle,scale=0.3}
}
\begin{axis}[
clip=false,
title=How \texttt{axis description cs} works in 3D
]
\addplot3 coordinates {(-5,-5,-5) (5,5,5)};
\draw[black!15] (axis description cs:0,0) rectangle (axis description cs:1,1);
\node[small dot,pin=120:{$(0,0)$}] at (axis description cs:0,0) {};
\node[small dot,pin=-30:{$(1,1)$}] at (axis description cs:1,1) {};
\node[small dot,pin=-90:{$(1.03,0.5)$}] at (axis description cs:1.03,0.5) {};
\node[small dot,pin=125:{$(0.5,0.5)$}] at (axis description cs:0.5,0.5) {};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\tikzset{
every pin/.style={fill=yellow!50!white,rectangle,rounded corners=3pt,font=\tiny},
small dot/.style={fill=black,circle,scale=0.3}
}
\begin{tikzpicture}
\begin{axis}[
clip=false,
ticklabel style={draw=red},
title=Positioning with \texttt{xticklabel cs}]
\addplot {x};
\node[small dot,pin=-90:{\texttt{xticklabel cs:0}}] at (xticklabel cs:0) {};
\node[small dot,pin=-90:{\texttt{xticklabel cs:0.5}}] at (xticklabel cs:0.5) {};
\node[small dot,pin=-90:{\texttt{xticklabel cs:1}}] at (xticklabel cs:1) {};
\node[small dot,pin=180:{\texttt{yticklabel cs:0}}] at (yticklabel cs:0) {};
\node[small dot,pin=180:{\texttt{yticklabel cs:0.5}}] at (yticklabel cs:0.5) {};
\node[small dot,pin=180:{\texttt{yticklabel cs:1}}] at (yticklabel cs:1) {};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% the same as above for 3D ...
\begin{tikzpicture}
\tikzset{
every pin/.style={fill=yellow!50!white,rectangle,rounded corners=3pt,font=\tiny},
small dot/.style={fill=black,circle,scale=0.3}
}
\begin{axis}[
ticklabel style={draw=red},
clip=false,
title=Positioning with \texttt{ticklabel cs} in 3D
]
\addplot3 coordinates {(-5,-5,-5) (5,5,5)};
\node[small dot,pin=-90:{\texttt{xticklabel cs:0}}] at (xticklabel cs:0) {};
\node[small dot,pin=-90:{\texttt{xticklabel cs:0.5}}] at (xticklabel cs:0.5) {};
\node[small dot,pin=-90:{\texttt{xticklabel cs:1}}] at (xticklabel cs:1) {};
\node[small dot,pin=-45:{\texttt{yticklabel cs:0}}] at (yticklabel cs:0) {};
\node[small dot,pin=-45:{\texttt{yticklabel cs:0.5}}] at (yticklabel cs:0.5) {};
\node[small dot,pin=-45:{\texttt{yticklabel cs:1}}] at (yticklabel cs:1) {};
\node[small dot,pin=180:{\texttt{zticklabel cs:0}}] at (zticklabel cs:0) {};
\node[small dot,pin=180:{\texttt{zticklabel cs:0.5}}] at (zticklabel cs:0.5) {};
\node[small dot,pin=180:{\texttt{zticklabel cs:1}}] at (zticklabel cs:1) {};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\tikzset{
every pin/.style={fill=yellow!50!white,rectangle,rounded corners=3pt,font=\tiny},
small dot/.style={fill=black,circle,scale=0.3}
}
\begin{tikzpicture}
\begin{axis}[
xticklabel style={draw=red},
clip=false,
title=\texttt{ticklabel cs} and its optional shift
]
\addplot3 coordinates {(-5,-5,-5) (5,5,5)};
\draw[blue,thick,->] (xticklabel cs:0,0) -- (xticklabel cs:1,0);
\draw[red,thick,->] (xticklabel cs:0,5pt) -- (xticklabel cs:1,5pt);
\draw[magenta,thick,->] (xticklabel cs:0,10pt) -- (xticklabel cs:1,10pt);
\draw[green,thick,->] (xticklabel cs:0,15pt) -- (xticklabel cs:1,15pt);
\node[small dot,pin=0:{\texttt{xticklabel cs:1,0}}] at (xticklabel cs:1,0) {};
\node[small dot,pin=0:{\texttt{xticklabel cs:1,15pt}}] at (xticklabel cs:1,15pt) {};
\draw[blue,thick,->] (xticklabel cs:0,0) -- (xticklabel cs:0,15pt);
\draw[blue,thick,->] (xticklabel cs:1,0) -- (xticklabel cs:1,15pt);
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=Without \texttt{near ticklabel},
ylabel={$f(x)=x$},
every axis y label/.style=
{at={(ticklabel cs:0.5)},rotate=90,anchor=center},
clip=false,% to display the \path below
ylabel style={draw=red},
yticklabel style={draw=red}
]
\addplot {x};
% visualize the position:
\fill (yticklabel cs:0.5) circle(2pt);
\end{axis}
\end{tikzpicture}%
~
\begin{tikzpicture}
\begin{axis}[
title=With \texttt{near ticklabel},
ylabel={$f(x)=x$},
every axis y label/.style=
{at={(ticklabel cs:0.5)},rotate=90,anchor=near ticklabel},
clip=false,
ylabel style={draw=red},
yticklabel style={draw=red}
]
\addplot {x};
\fill (yticklabel cs:0.5) circle(2pt);
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=Variable 1,
ylabel=Variable 2,
zlabel=value,
xlabel style={sloped like x axis},
ylabel style={sloped}
]
\addplot3[surf] {y*x*(1-x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel=Dof,ylabel=Error,
title={$\mu=0.1$, $\sigma=0.2$}]
\addplot 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}%

[.tex]
[.pdf]
\pgfplotsset{every axis/.append style={
extra description/.code={
\node at (0.5,0.5) {Center!};
}}}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot[smooth,mark=*,blue] coordinates {
(0,2)
(2,3)
(3,1)
};
\addlegendentry{Case 1}
\addplot[smooth,color=red,mark=x]
coordinates {
(0,0)
(1,1)
(2,1)
(3,2)
};
\addlegendentry{Case 2}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\foreach \p in {1,2,3} {
\addplot {x^\p};
\addlegendentryexpanded{$x^\p$}
}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend entries={$x$,$x^2$}]
\addplot {x};
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend entries={$x$,$x^2$}]
\addplot {x};
\addplot {x^2};
\legend{$a$,$b$}% overrides the option
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
% this modifies 'every axis legend':
legend style={font=\large}
]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
% align right:
legend style={
cells={anchor=east},
legend pos=outer north east,
}
]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$, legend $2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% similar placement as previous example:
\pgfplotsset{every axis legend/.append style={
at={(1.02,1)},
anchor=north west}}
\begin{tikzpicture}
\begin{axis}
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\pgfplotsset{every axis legend/.append style={
at={(0.5,1.03)},
anchor=south}}
\begin{axis}[legend columns=4]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
legend style={
at={(1,0.5)},
anchor=east}]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=south west]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=south east]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=north east]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=north west]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=outer north east]
\addplot coordinates {(0,0) (1,1)};
\addplot coordinates {(0,1) (1,2)};
\addplot coordinates {(0,2) (1,3)};
\legend{$l_1$,$l_2$,$l_3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% \usetikzlibrary{patterns}
\begin{tikzpicture}
\begin{axis}[area legend,
axis x line=bottom,
axis y line=left,
domain=0:1,
legend style={at={(0.03,0.97)},
anchor=north west},
axis on top,xmin=0]
\addplot[pattern=crosshatch dots,
pattern color=blue,draw=blue,
samples=500]
{sqrt(x)} \closedcycle;
\addplot[pattern=crosshatch,
pattern color=blue!30!white,
draw=blue!30!white]
{x^2} \closedcycle;
\addplot[red,line legend] coordinates {(0,0) (1,1)};
\legend{$\sqrt x$,$x^2$,$x$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=north west]
\addplot {x^3};
\addplot[ybar,fill=red,draw=red!60,
ybar legend,mark=none,samples=5]
{-30*(x +4)};
\legend{first,second}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[legend pos=outer north east]
\addplot3[surf,samples=9,domain=0:1]
{(1-abs(2*(x-0.5))) * (1-abs(2*(y-0.5)))};
\addlegendentry{$\phi_x \phi_y$}
\addplot3+[ultra thick] coordinates {(0,0,0) (0.5,0,1) (1,0,0)};
\addlegendentry{$\phi_x $}
\addplot3+[ultra thick] coordinates {(1,0,0) (1,0.5,1) (1,1,0)};
\addlegendentry{$\phi_y $}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[reverse legend]
\addplot {x};
\addlegendentry{$x$}
\addplot {x^2};
\addlegendentry{$x^2$}
\addplot {x^3};
\addlegendentry{$x^3$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}[baseline]
\begin{axis}
\addplot+[only marks,
samples=15,
error bars/y dir=both,
error bars/y fixed=2.5]
{3*x+2.5*rand};
\label{pgfplots:label1}
\addplot+[mark=none] {3*x};
\label{pgfplots:label2}
\addplot {4*cos(deg(x))};
\label{pgfplots:label3}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,ylabel=$\sin x$]
\addplot[blue,mark=none,
domain=-10:0,samples=40]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=right,
ymax=1.1, ymin=-1.1,
xlabel=$x$,ylabel=$\sin x$
]
\addplot[blue,mark=none,
domain=-10:0,samples=40]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis x line=bottom,
axis y line=left,
xlabel=$x$,ylabel=$\sqrt{|x|}$
]
\addplot[blue,mark=none,
domain=-4:4,samples=501]
{sqrt(abs(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
minor tick num=3,
axis y line=center,
axis x line=middle,
xlabel=$x$,ylabel=$\sin x$
]
\addplot[smooth,blue,mark=none,
domain=-5:5,samples=40]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
minor tick num=3,
axis y line=left,
axis x line=middle,
xlabel=$x$,ylabel=$\sin x$
]
\addplot[smooth,blue,mark=none,
domain=-5:5,samples=40]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
minor tick num=1,
axis x line=middle,
axis y line=middle,
every inner x axis line/.append style=
{|->>},
every inner y axis line/.append style=
{|->>},
xlabel=$x$,ylabel=$y^3$
]
\addplot[blue,domain=-3:5] {x^3};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
separate axis lines, % important !
every outer x axis line/.append style=
{-stealth},
every outer y axis line/.append style=
{-stealth},
]
\addplot[blue,id=DoG,
samples=100,
domain=-15:15]
gnuplot{1.3*exp(-x**2/10) - exp(-x**2/20)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
separate axis lines,
every outer x axis line/.append style=
{-stealth,red},
every outer y axis line/.append style=
{-stealth,green!30!black},
]
\addplot[blue,
samples=100,
domain=-15:15]
{1.3*exp(0-x^2/10) - exp(0-x^2/20)};
% Unfortunately, there is a bug in PGF 2.00
% something like exp(-10^2)
% must be written as exp(0-10^2) :-(
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
separate axis lines=false,
every outer x axis line/.append style=
{-stealth,red},
every outer y axis line/.append style=
{-stealth,green!30!black},
]
\addplot[blue,id=DoG,
samples=100,
domain=-15:15]
gnuplot{1.3*exp(-x**2/10) - exp(-x**2/20)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
scale only axis,
xmin=-5,xmax=5,
axis y line=left,
xlabel=$x$,
ylabel=First ordinate]
\addplot {x^2};
\end{axis}
\begin{axis}[
scale only axis,
xmin=-5,xmax=5,
axis y line=right,
axis x line=none,
ylabel=Second ordinate]
\addplot[red] {3*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% \usepackage{textcomp}
\begin{tikzpicture}
\begin{axis}[
scale only axis,
xmin=-5,xmax=5,
axis y line=left,
xlabel=$x$,
ylabel=Absolute]
\addplot {x^2};
\end{axis}
\begin{axis}[
scale only axis,
xmin=-5,xmax=5,
ymin=0,ymax=1000,
yticklabel=
{$\pgfmathprintnumber{\tick}$\textperthousand},
axis y line=right,
axis x line=none,
y label style={yshift=-10pt},
ylabel=per thousand]
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis x line=bottom,
axis x discontinuity=parallel,
axis y line=left,
xmin=360, xmax=600,
ymin=0, ymax=7,
enlargelimits=false
]
\addplot coordinates {
(420,2)
(500,6)
(590,4)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis x line=bottom,
axis y line=center,
tick align=outside,
axis y discontinuity=crunch,
ymin=95, enlargelimits=false
]
\addplot[blue,mark=none,
domain=-4:4,samples=20]
{x*x+x+104};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis x line=bottom,
axis y line=center,
tick align=outside,
axis y discontinuity=crunch,
xtickmax=3,
ytickmin=110,
ymin=95, enlargelimits=false
]
\addplot[blue,mark=none,
domain=-4:4,samples=20]
{x*x+x+104};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
hide x axis,
hide y axis,
title={$x^2\cos(x)$}]
\addplot {cos(x)*x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
hide x axis,
axis y line=left,
title={$x^2\cos(x)$}]
\addplot {cos(x)*x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar]
\addplot[mesh,ultra thick] {x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar,colormap/greenyellow]
\addplot[mesh,ultra thick] {x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar horizontal]
\addplot[mesh,ultra thick] {x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar right]
\addplot[mesh,thick,samples=150,domain=0.1:3]
{1/x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar left]
\addplot[mesh,thick,samples=150]
{x*sin(deg(4*x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar horizontal]
\addplot[only marks,scatter,
scatter src={mod(\coordindex,15)},samples=150]
{rand};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
colorbar horizontal,
colorbar style={
at={(0.5,1.03)},anchor=south,
xticklabel pos=upper
},
title style={yshift=1cm},
title=Customization: ``colorbar top'']
\addplot[mesh,thick,samples=150,domain=0.1:3]
{x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
colorbar horizontal,
colorbar style={
at={(1,1.03)},anchor=south east,
width=0.5*
\pgfkeysvalueof{/pgfplots/parent axis width},
xticklabel pos=upper,
},
title style={yshift=1cm},
title=More Customization: ``colorbar top'']
\addplot[mesh,thick,samples=150,domain=0.1:3]
{x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
view/az=45,
colorbar,
colorbar/width=2cm,
colormap/blackwhite]
\addplot3[surf,domain=0:1,y domain=-3:3] {x*(1-x)*tanh(y)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[normalsize,
title=A ``normalsize'' figure,
xlabel=The $x$ axis,
ylabel=The $y$ axis,
minor tick num=1,
legend entries={Leg}]
\addplot {max(4*x,7*x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[small,
title=A ``small'' figure,
xlabel=The $x$ axis,
ylabel=The $y$ axis,
minor tick num=1,
legend entries={Leg}]
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[footnotesize,
title=A ``footnotesize'' figure,
xlabel=The $x$ axis,
ylabel=The $y$ axis,
minor tick num=1,
legend entries={Leg}]
\addplot+[const plot]
coordinates {
(0,0) (1,1) (3,3) (5,10)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot {x^2+2} \closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[fill] {x^2+2} \closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[stack plots=y]
\addplot+[fill] coordinates
{(0,1) (1,1) (2,2) (3,2)} \closedcycle;
\addplot+[fill] coordinates
{(0,1) (1,1) (2,2) (3,2)} \closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[x filter/.code=
{\pgfmathadd{#1}{0.5}}]
\addplot coordinates {
(4,0)
(6,1)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
samples=20,
x filter/.code={
\ifnum\coordindex>4
\ifnum\coordindex<11
\def\pgfmathresult{}
\fi
\fi
}]
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
samples=20,
skip coords between index={5}{11},
skip coords between index={15}{18}]
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
restrict y to domain=-10:10,
samples=1000,
% some fine tuning for the display:
width=10cm, height=210pt,
xmin=-4.7124, xmax=4.7124,
xtick={-4.7124,-1.5708,...,10},
xticklabels={$-\frac32 \pi$,$-\pi/2$,$\pi/2$,$\frac32 \pi$},
axis x line=center,
axis y line=center]
\addplot[blue] gnuplot[id=tangens,domain=-1.5*pi:1.5*pi] {tan(x)};
\legend{$\tan(x)$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[error bars/.cd,
y dir=plus,y explicit]
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}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot+[error bars/.cd,
y dir=both,y explicit,
x dir=both,x fixed=0.05,
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) +- (0.1,0.2)
(1,1) +- (0.3,0.1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotstabletypeset{pgfplots.testtable2.dat}
\begin{tikzpicture}
\begin{loglogaxis}
\addplot+[error bars/.cd,
x dir=both,x fixed relative=0.5,
y dir=both,y explicit relative,
error mark=triangle*]
table[x=x,y=y,y error=errory]
{pgfplots.testtable2.dat};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[enlargelimits=false]
\addplot[red,mark=*]
plot[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}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
grid=both,
tick align=outside,
tickpos=left]
\addplot coordinates
{(100,1e-4) (500,1e-5) (1000,3e-6)};
\addplot coordinates
{(100,1e-5) (500,4e-6) (1000,2e-6)};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\tikzstyle{every pin}=[fill=white,
draw=black,
font=\footnotesize]
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel={\textsc{Dof}},
ylabel={$L_2$ Error}]
\addplot coordinates {
(11, 6.887e-02)
(71, 3.177e-02)
(351, 1.341e-02)
(1471, 5.334e-03)
(5503, 2.027e-03)
(18943, 7.415e-04)
(61183, 2.628e-04)
(187903, 9.063e-05)
(553983, 3.053e-05)
};
\node[coordinate,pin=above:{Bad!}]
at (axis cs:5503,2.027e-03) {};
\node[coordinate,pin=left:{Good!}]
at (axis cs:187903,9.063e-05) {};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
xlabel=\textsc{Dof},
ylabel=$L_2$ Error
]
\draw
(axis cs:1793,4.442e-05)
|- (axis cs:4097,1.207e-05)
node[near start,left]
{$\frac{dy}{dx} = -1.58$};
\addplot 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}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot3[surf] {x^2 - y^2};
\draw (rel axis cs:0,0,1)
-- (rel axis cs:1,1,1);
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel=$y$,
zlabel=$z$,
every axis x label/.style={
at={(rel axis cs:0.5,-0.15,-0.15)}},
every axis y label/.style={
at={(rel axis cs:1.15,0.5,-0.15)}},
every axis z label/.style={
at={(rel axis cs:-0.15,-0.15,0.5)}},
]
\addplot3[surf] {x*(1-x)*y};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[y=2cm]
\addplot coordinates
{(-2,0) (-1,1) (0,0) (1,1) (2,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\tikzset{every mark/.append style={scale=2}}
\begin{tikzpicture}
\begin{axis}[y=2cm]
\addplot coordinates
{(-2,0) (-1,1) (0,0) (1,1) (2,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% Overwrite any cycle list:
\pgfplotsset{
every axis plot post/.append style={
mark=triangle,
every mark/.append style={rotate=90}}}
\begin{tikzpicture}
\begin{axis}[y=2cm]
\addplot coordinates
{(-2,0) (-1,1) (0,0) (1,1) (2,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[enlarge x limits=false]
\addplot[red,samples=500] {sin(deg(x))};
\addplot[orange,samples=7] {sin(deg(x))};
\addplot[teal,const plot,
samples=14] {sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
colormap={bw}{gray(0cm)=(0); gray(1cm)=(1)}]
\addplot+[scatter,only marks,
domain=0:8,samples=100]
{exp(x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colormap/bluered]
\addplot+[scatter,
scatter src=x,samples=50]
{sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
stack plots=y,stack dir=minus,
cycle list name=color]
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
stack plots=y,stack dir=minus,
cycle list name=exotic]
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
stack plots=y,stack dir=minus,
cycle list name=black white]
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
stack plots=y,stack dir=minus,
cycle list name=mark list]
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
stack plots=y,stack dir=minus,
cycle list name=color list]
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
stack plots=y,stack dir=minus,
cycle list name=linestyles]
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\addplot coordinates {(0,1) (0.5,1) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
cycle multi list={
red,blue\nextlist
solid,{dotted,mark options={solid}}\nextlist
mark=*,mark=x,mark=o
},
samples=3,
legend entries={0,...,20},
legend pos=outer north east
]
\addplot {x};
\addplot {x-1};
\addplot {x-2};
\addplot {x-3};
\addplot {x-4};
\addplot {x-5};
\addplot {x-6};
\addplot {x-7};
\addplot {x-8};
\addplot {x-9};
\addplot {x-10};
\addplot {x-11};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title={Cycle color between successive plots, then marks},
cycle multi list={
mark list\nextlist
blue,red%
},
samples=3,
legend entries={0,...,20},
legend pos=outer north east
]
\addplot {x};
\addplot {x-1};
\addplot {x-2};
\addplot {x-3};
\addplot {x-4};
\addplot {x-5};
\addplot {x-6};
\addplot {x-7};
\addplot {x-8};
\addplot {x-9};
\addplot {x-10};
\addplot {x-11};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title={Cycle 2 marks between successive plots, then colors},
cycle multi list={%
blue,red\nextlist
[2 of]mark list
},
samples=3,
legend entries={0,...,20},
legend pos=outer north east
]
\addplot {x};
\addplot {x-1};
\addplot {x-2};
\addplot {x-3};
\addplot {x-4};
\addplot {x-5};
\addplot {x-6};
\addplot {x-7};
\addplot {x-8};
\addplot {x-9};
\addplot {x-10};
\addplot {x-11};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis background/.style={fill=blue!10}]
\addplot3[surf,y domain=0:1]
{sin(deg(x)) * y*(1-y)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}[
axis background/.style={
shade,top color=gray,bottom color=white},
legend style={fill=white}]
\addplot {exp(-x)};
\addplot {exp(-4*x)};
\legend{$e^{-x}$,$e^{-4x}$}
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[colorbar]
\addplot[mesh,point meta=y,thick] {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=Axis wide color mapping,
colorbar,
samples=50,point meta rel=axis wide,
point meta=y]
\addplot[mesh,thick] {sin(deg(x))};
\addplot[mesh,thick] {3*tanh(x)};
\end{axis}
\end{tikzpicture}
~
\begin{tikzpicture}
\begin{axis}[
title=Per Plot color mapping,
colorbar,
samples=50,
point meta rel=per plot,
point meta=y]
\addplot[mesh,thick] {sin(deg(x))};
\addplot[mesh,thick] {3*tanh(x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
% some descriptions:
table/x=Basis,
table/y={L2/r},
xlabel=Degrees of Freedom,
ylabel=relative Error,
title=New Experiments (old in gray),
legend entries={$e_1$,$e_2$,$e_3$}
]
\addplot[black!15,forget plot]
table {plotdata/oldexperiment1.dat};
\addplot[black!15,forget plot]
table {plotdata/oldexperiment2.dat};
\addplot[black!15,forget plot]
table {plotdata/oldexperiment3.dat};
\addplot table {plotdata/newexperiment1.dat};
\addplot table {plotdata/newexperiment2.dat};
\addplot table {plotdata/newexperiment3.dat};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
forget plot style={opacity=0.2},
% same as above:
table/x=Basis,
table/y={L2/r},
xlabel=Degrees of Freedom,
ylabel=relative Error,
title=New Experiments (old in transparent),
legend entries={$e_1$,$e_2$,$e_3$},
]
\foreach \exp in {1,2,3} {
\addplot+[forget plot]
table {plotdata/oldexperiment\exp.dat};
\addplot table {plotdata/newexperiment\exp.dat};
}
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotsset{every axis/.append style={
before end axis/.code={
\fill[red] (axis cs:1,10) circle(5pt);
\node at (axis cs:-4,10)
{\large This text has been inserted
using \texttt{before end axis}.};
}}}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotsset{every axis/.append style={
after end axis/.code={
\fill[red] (axis cs:1,10) circle(5pt);
\node at (axis cs:-4,10)
{\large This text has been inserted using \texttt{after end axis}.};
}}}
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis on top=true,
axis x line=middle,
axis y line=middle]
\addplot+[fill] {x^3} \closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
axis on top=false,
axis x line=middle,
axis y line=middle]
\addplot+[fill] {x^3} \closedcycle;
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}%
\begin{loglogaxis}
[title=Standard options,
width=6cm]
\addplot coordinates {
(1e-2,10)
(3e-2,100)
(6e-2,200)
};
\end{loglogaxis}
\end{tikzpicture}%

[.tex]
[.pdf]
\pgfplotsset{every axis/.append style={%
width=6cm,
xmin=7e-3,xmax=7e-2,
extra x ticks={3e-2,6e-2},
extra x tick style={major tick length=0pt,font=\footnotesize}
}}%
\begin{tikzpicture}%
\begin{loglogaxis}[
xtick={1e-2},
title=with minor tick identification,
extra x tick style={
log identify minor tick positions=true}]
\addplot coordinates {
(1e-2,10)
(3e-2,100)
(6e-2,200)
};
\end{loglogaxis}
\end{tikzpicture}%
\begin{tikzpicture}%
\begin{loglogaxis}[
xtick={1e-2},
title=without minor tick identification,
extra x tick style={
log identify minor tick positions=false}]
\addplot coordinates {
(1e-2,10)
(3e-2,100)
(6e-2,200)
};
\end{loglogaxis}%
\end{tikzpicture}%

[.tex]
[.pdf]
\pgfplotsset{
samples=15,
width=7cm,
xlabel=$x$,
ylabel=$f(x)$,
extra y ticks={45},
legend style={at={(0.03,0.97)},
anchor=north west}}
\begin{tikzpicture}
\begin{semilogyaxis}[
log plot exponent style/.style={
/pgf/number format/fixed zerofill,
/pgf/number format/precision=1},
domain=-5:10]
\addplot {exp(x)};
\addplot {exp(2*x)};
\legend{$e^x$,$e^{2x}$}
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotsset{
samples=15,
width=7cm,
xlabel=$x$,
ylabel=$f(x)$,
extra y ticks={45},
legend style={at={(0.03,0.97)},
anchor=north west}}
\begin{tikzpicture}
\begin{semilogyaxis}[
log plot exponent style/.style={
/pgf/number format/fixed,
/pgf/number format/use comma,
/pgf/number format/precision=2},
domain=-5:10]
\addplot {exp(x)};
\addplot {exp(2*x)};
\legend{$e^x$,$e^{2x}$}
\end{semilogyaxis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}
\addplot[key=value,key2=value2] ... ;
\addplot+[key=value,key2=value2] ... ; % keeps the keys which would have been used by default
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[x=1cm,y=1cm]
\addplot expression[domain=0:3] {2*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[x=1cm,y=-0.5cm]
\addplot expression[domain=0:3] {2*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[x={(1cm,0.1cm)},y=1cm]
\addplot expression[domain=0:3] {2*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
x={(5pt,1pt)},
y={(-4pt,4pt)}]
\addplot {1-x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[axis equal=false,grid=major]
\addplot[blue] expression[domain=0:2*pi,samples=300] {sin(deg(x))*sin(2*deg(x))};
\end{axis}
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
\begin{axis}[axis equal=true,grid=major]
\addplot[blue] expression[domain=0:2*pi,samples=300] {sin(deg(x))*sin(2*deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[axis equal=false,grid=major]
\addplot expression[domain=1:10000] {x^-2};
\end{loglogaxis}
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
\begin{loglogaxis}[axis equal=true,grid=major]
\addplot expression[domain=1:10000] {x^-2};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[axis equal image=false,grid=major]
\addplot[blue] expression[domain=0:2*pi,samples=300] {sin(deg(x))*sin(2*deg(x))};
\end{axis}
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
\begin{axis}[axis equal image=true,grid=major]
\addplot[blue] expression[domain=0:2*pi,samples=300] {sin(deg(x))*sin(2*deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[axis equal image=false,grid=major]
\addplot expression[domain=1:10000] {x^-2};
\end{loglogaxis}
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
\begin{loglogaxis}[axis equal image=true,grid=major]
\addplot expression[domain=1:10000] {x^-2};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[xmin=0]
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[ymax=10]
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$ \emph{decreasing} $\to$,
x dir=reverse]
\addplot {x+rand*0.3};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
ylabel=$y$ \emph{decreasing} $\to$,
y dir=reverse]
\addplot {x^2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
ylabel=$y$ \emph{decreasing} $\to$,
xlabel=$x$ normal,
title=reversed axis,
y dir=reverse,
colorbar,
colorbar style={y dir=reverse}]
\addplot+[mesh,scatter] {x^15};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}
\addplot {5 * x^3 - x^2 + 4*x -2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[enlarge x limits=0.2]
\addplot {5 * x^3 - x^2 + 4*x -2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[minor x tick num=4,
enlarge x limits={rel=0.5,upper}
]
\addplot {5 * x^3 - x^2 + 4*x -2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[minor x tick num=4,
enlarge x limits={abs=3}
]
\addplot {5 * x^3 - x^2 + 4*x -2};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[enlarge x limits={abs=11}]
\addplot+[domain=1:100000] {x^-2};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\pgfplotsset{
every axis plot post/.append style=
{mark=none}}
\begin{axis}[
legend style={
at={(0.03,0.97)},anchor=north west},
domain=0:1]
\addplot {x^2};
\addplot {exp(x)};
\legend{$x^2$,$e^x$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotsset{my personal style/.style=
{grid=major,font=\large}}
\begin{tikzpicture}
\begin{axis}[my personal style]
\addplot coordinates {(0,0) (1,1)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[symbolic x coords={a,b,c,d,e,f,g,h,i}]
\addplot+[smooth] coordinates {
(a,42)
(b,50)
(c,80)
(f,60)
(g,62)
(i,90)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% requires \usepgfplotslibrary{dateplot} !
\pgfplotstabletypeset[string type]{plotdata/accounts.dat}
\begin{tikzpicture}
\begin{axis}[
date coordinates in=x,
xticklabel={\day.\month.},
xlabel={2008},
stack plots=y,
yticklabel={\pgfmathprintnumber{\tick}\EUR{}}, % <- requires \usepackage{eurosym}
ylabel=Total credit,
ylabel style={yshift=10pt},
legend style={
at={(0.5,-0.3)},anchor=north,legend columns=-1}]
\addplot table[x=date,y=account1] {plotdata/accounts.dat};
\addplot table[x=date,y=account2] {plotdata/accounts.dat};
\addplot table[x=date,y=account3] {plotdata/accounts.dat};
\legend{Giro,Tagesgeld,Sparbuch}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% requires \usepgfplotslibrary{dateplot} !
\begin{tikzpicture}
\begin{axis}[
date coordinates in=x,
xtick=data,
xticklabel style=
{rotate=90,anchor=near xticklabel},
xticklabel=\day. \hour:\minute,
date ZERO=2009-08-18,% <- improves precision!
]
\addplot coordinates {
(2009-08-18 09:00, 050)
(2009-08-18 12:00, 100)
(2009-08-18 15:00, 100)
(2009-08-18 18:35, 100)
(2009-08-18 21:30, 040)
(2009-08-19, 020)
(2009-08-19 3:00, 000)
(2009-08-19 6:0, 035)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[symbolic x coords={a,b,c,d,e,f,g,h,i}]
\addplot+[smooth] coordinates {
(a,42)
(b,50)
(c,80)
(f,60)
(g,62)
(i,90)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% requires \usepgfplotslibrary{dateplot} !
\pgfplotstabletypeset[string type]{plotdata/accounts.dat}
\begin{tikzpicture}
\begin{axis}[
date coordinates in=x,
xticklabel={\day.\month.},
xlabel={2008},
stack plots=y,
yticklabel={\pgfmathprintnumber{\tick}\EUR{}}, % <- requires \usepackage{eurosym}
ylabel=Total credit,
ylabel style={yshift=10pt},
legend style={
at={(0.5,-0.3)},anchor=north,legend columns=-1}]
\addplot table[x=date,y=account1] {plotdata/accounts.dat};
\addplot table[x=date,y=account2] {plotdata/accounts.dat};
\addplot table[x=date,y=account3] {plotdata/accounts.dat};
\legend{Giro,Tagesgeld,Sparbuch}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
% requires \usepgfplotslibrary{dateplot} !
\begin{tikzpicture}
\begin{axis}[
date coordinates in=x,
xtick=data,
xticklabel style=
{rotate=90,anchor=near xticklabel},
xticklabel=\day. \hour:\minute,
date ZERO=2009-08-18,% <- improves precision!
]
\addplot coordinates {
(2009-08-18 09:00, 050)
(2009-08-18 12:00, 100)
(2009-08-18 15:00, 100)
(2009-08-18 18:35, 100)
(2009-08-18 21:30, 040)
(2009-08-19, 020)
(2009-08-19 3:00, 000)
(2009-08-19 6:0, 035)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xtick=\empty,
ytick={-2,0.3,3,3.7,4.5}]
\addplot+[smooth] coordinates {
(-2,3) (-1.5,2) (-0.3,-0.2)
(1,1.2) (2,2) (3,5)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[xtick=data,xmajorgrids]
\addplot coordinates {
(1,2)
(2,5)
(4,6.5)
(6,8)
(10,9)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{loglogaxis}[
title=A log plot with small axis range]
\addplot coordinates {
(10,1e-4)
(17,8.3176e-05)
(25,7.0794e-05)
(50,5e-5)
};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[minor tick num=1]
\addplot {x^3};
\addplot {-20*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[minor tick num=3]
\addplot {x^3};
\addplot {-20*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[minor x tick num=1,
minor y tick num=3]
\addplot {x^3};
\addplot {-20*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xmin=0,xmax=3,ymin=0,ymax=15,
extra y ticks={2.71828},
extra y tick labels={$e$},
extra x ticks={2.2},
extra x tick style={grid=major,
tick label style={
rotate=90,anchor=east}},
extra x tick labels={Cut},
]
\addplot {exp(x)};
\addlegendentry{$e^x$}
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotsset{every axis/.append style={width=5.3cm}}
\begin{tikzpicture}
\begin{loglogaxis}[
title=Explicitly Provided Limits,
xtickten={1,2},
ytickten={-5,-6}]
\addplot coordinates
{(10,1e-5) (20,5e-6) (40,2.5e-6)};
\end{loglogaxis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{loglogaxis}[
title=With Extra Ticks,
xtickten={1,2},
ytickten={-5,-6},
extra x ticks={20,40},
extra y ticks={5e-6,2.5e-6}]
\addplot coordinates
{(10,1e-5) (20,5e-6) (40,2.5e-6)};
\end{loglogaxis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{loglogaxis}[
title=With Extra Ticks; $10^e$ format,
extra tick style={log identify minor tick positions=false},
xtickten={1,2},
ytickten={-5,-6},
extra x ticks={20,40},
extra y ticks={5e-6,2.5e-6}]
\addplot coordinates
{(10,1e-5) (20,5e-6) (40,2.5e-6)};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}[
samples=8,
ytickten={-6,-4,...,4},
domain=0:10]
\addplot {2^(-2*x + 6)};
\addlegendentry{$2^{-2x + 6}$}
% or invoke gnuplot to generate coordinates:
\addplot gnuplot[id=pow2]
{2**(-1.5*x -3)};
\addlegendentry{$2^{-1.5x -3}$}
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xtick={-1.5,-1,...,1.5},
xticklabels={%
$-1\frac 12$,
$-1$,
$-\frac 12$,
$0$,
$\frac 12$,
$1$}
]
\addplot[smooth,blue,mark=*]
coordinates {
(-1, 1)
(-0.75, 0.5625)
(-0.5, 0.25)
(-0.25, 0.0625)
(0, 0)
(0.25, 0.0625)
(0.5, 0.25)
(0.75, 0.5625)
(1, 1)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}[
ytickten={-2,-1,0,1,2},
yticklabels={$\frac{1}{100}$,%
$\frac{1}{10}$,%
1,10,100},
]
\addplot {exp(x)};
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}[
yticklabel style={/pgf/number format/fixed},
% changes tick labels to a number instead
% of exponential notation:
yticklabel={%
\pgfmathfloatparsenumber{\tick}%
\pgfmathfloatexp{\pgfmathresult}%
\pgfmathprintnumber{\pgfmathresult}%
},
]
\addplot {exp(x)};
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=A special Prewavelet,
xtick={0,1,0.5,0.25,0.75},
xticklabels={$0$,$1$,$\frac12$,$\frac14$,$\frac34$},
ytick=data,
ymajorgrids,
yticklabel={%
\scriptsize
\ifdim\tick pt<0pt % a TeX \if -- see TeX Book
\pgfmathparse{-10*\tick}%
$-\pgfmathprintnumber{\pgfmathresult}/10$%
\else
\pgfmathparse{10*\tick}%
$\pgfmathprintnumber{\pgfmathresult}/10$%
\fi
}
]
\addplot coordinates {(0,-1.2) (0.25,1.1)
(0.5,-0.6) (0.75,0.1) (1,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[x tick label as interval]
\addplot {3*x};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
ybar interval=0.9,
x tick label as interval,
xmin=2003,xmax=2030,
ymin=0,ymax=140,
xticklabel={
$\pgfmathprintnumber{\tick}$
-- $\pgfmathprintnumber{\nexttick}$},
xtick=data,
x tick label style={
rotate=90,anchor=east,
/pgf/number format/1000 sep=}
]
\addplot[draw=blue,fill=blue!40!white]
coordinates
{(2003,40) (2005,100) (2006,15)
(2010,90) (2020,120) (2030,3)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xtick=data,ytick=data,
xtick align=center]
\addplot coordinates
{(-3,0) (-2,0.1) (-1,-0.6)
(0,1)
(1,-0.6) (2,0.1) (3,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xtick=data,ytick=data,
ytick align=outside]
\addplot coordinates
{(-3,0) (-2,0.1) (-1,-0.6)
(0,1)
(1,-0.6) (2,0.1) (3,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xtick=data,
axis x line=center,
xticklabels={,,},
ytick={-0.6,0,0.1,1},
yticklabels={
$-\frac{6}{10}$,,
$\frac{1}{10}$,$1$},
ymajorgrids,
axis y line=left,
enlargelimits=0.05]
\addplot coordinates
{(-3,0) (-2,0.1) (-1,-0.6)
(0,1)
(1,-0.6) (2,0.1) (3,0)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[scaled ticks=true]
\addplot coordinates {
(20000,0.0005)
(40000,0.0010)
(60000,0.0020)
};
\end{axis}
\end{tikzpicture}%

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[scaled ticks=false]
\addplot coordinates {
(20000,0.0005)
(40000,0.0010)
(60000,0.0020)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[scaled ticks=base 10:3,
/pgf/number format/sci subscript]
\addplot coordinates
{(-0.00001,2e12) (-0.00005,4e12) };
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
xtick={0,1.5708,...,10},
domain=0:2*pi,
scaled x ticks={real:3.1415},
xtick scale label code/.code={$\cdot \pi$}]
\addplot {sin(deg(x))};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
scaled x ticks=real:2,
scaled y ticks=real:3]
\addplot {x^3};
\node[pin=135:{$(3,9)$}] at (axis cs:3,9) {};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
% warning: the '%' signs are necessary (?)
scaled y ticks=manual:{$+65\,535$}{%
\pgfmathfloatcreate{1}{6.5535}{4}%
\pgfmathfloatsubtract{#1}{\pgfmathresult}%
},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/precision=1},
]
\addplot coordinates {
(0, 65535)
(13, 65535)
(14, 65536)
(15, 65537)
(30, 65537)
};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=\texttt{tick scale
binop=\textbackslash cdot}]
\addplot
[mark=none,blue,samples=250,
domain=0:5]
{exp(10*x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
title=\texttt{tick scale
binop=\textbackslash times},
tick scale binop=\times]
\addplot
[mark=none,blue,samples=250,
domain=0:5]
{exp(10*x)};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{semilogyaxis}[log basis y=2,grid=major,samples at={-4,...,4}]
\addplot {2^x};
\end{semilogyaxis}
\end{tikzpicture}
~
\begin{tikzpicture}
\begin{semilogyaxis}[log basis y=10,samples at={-4,...,4}]
\addplot {2^x};
\end{semilogyaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
enlargelimits=0.01,
title style={yshift=5pt},
title=Scatter plot with $2250$ points]
\addplot[blue,
mark=*,only marks,mark options={scale=0.3}]
file[skip first]
{plotdata/pgfplots_scatterdata3.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\begin{tikzpicture}
\begin{axis}[
enlarge x limits=0.03,
title=Ornstein-Uhlenbeck sample
($13000$ time steps),
xlabel=$t$]
\addplot[blue] file {plotdata/ou.dat};
\end{axis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotstabletypeset{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{% global config, for example in the preamble
% these columns//.style={} things define a style
% which applies to only.
columns/dof/.style={int detect,column type=r,column name=\textsc{Dof}},
columns/error1/.style={
sci,sci zerofill,sci sep align,precision=1,sci superscript,
column name=$e_1$,
},
columns/error2/.style={
sci,sci zerofill,sci sep align,precision=2,sci 10e,
column name=$e_2$,
},
columns/{grad(log(dof),log(error2))}/.style={
string replace={0}{}, % erase '0'
column name={$\nabla e_2$},
dec sep align,
},
columns/{quot(error1)}/.style={
string replace={0}{}, % erase '0'
column name={$\frac{e_1^{(n)}}{e_1^{(n-1)}}$}
},
empty cells with={--}, % replace empty cells with '--'
every head row/.style={before row=\toprule,after row=\midrule},
every last row/.style={after row=\bottomrule}
}
\pgfplotstabletypeset[ % local config, applies only for this table
1000 sep={\,},
columns/info/.style={
fixed,fixed zerofill,precision=1,showpos,
column type=r,
}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableread{pgfplotstable.example1.dat}\table
\pgfplotstabletypeset[columns={dof,error1}]\table
\hspace{2cm}
\pgfplotstabletypeset[columns={dof,error2}]\table

[.tex]
[.pdf]
\pgfplotstabletypeset[col sep=comma]{pgfplotstable.example1.csv}

[.tex]
[.pdf]
\pgfplotstabletypeset[columns={dof,level,[index]4}]{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[
columns/error1/.style={
column name=$L_2$,
sci,sci zerofill,sci subscript,
precision=3},
columns/error2/.style={
column name=$A$,
sci,sci zerofill,sci subscript,
precision=2},
columns/dof/.style={
int detect,
column name=\textsc{Dof}
}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[
columns={dof,error1,{grad(log(dof),log(error2))}},
columns/error1/.style={
column name=$L_2$,
sci,sci zerofill,sci subscript,
precision=3},
columns/dof/.style={
int detect,
column name=\textsc{Dof}},
columns/{grad(log(dof),log(error2))}/.style={
column name=slopes $L_2$,
fixed,fixed zerofill,
precision=1}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[
columns={dof,error1,info},
column type/.add={|}{}% results in '|c'
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstabletypeset[
columns={dof,error1,error2,info,{grad(log(dof),log(error2))}},
columns/error1/.style={dec sep align},
columns/error2/.style={sci,sci subscript,sci zerofill,dec sep align},
columns/info/.style={fixed,dec sep align},
columns/{grad(log(dof),log(error2))}/.style={fixed,dec sep align}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstabletypeset[
use comma,
columns={dof,error1,error2,info,{grad(log(dof),log(error2))}},
columns/error1/.style={dec sep align},
columns/error2/.style={sci,sci subscript,sci zerofill,dec sep align},
columns/info/.style={fixed,dec sep align},
columns/{grad(log(dof),log(error2))}/.style={fixed,dec sep align}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstabletypeset[
use comma,
columns={dof,error1,error2,info,{grad(log(dof),log(error2))}},
columns/error1/.style={dec sep align,sci zerofill},
columns/error2/.style={sci,sci subscript,sci zerofill,dec sep align},
columns/info/.style={fixed,dec sep align},
columns/{grad(log(dof),log(error2))}/.style={fixed,dec sep align,fixed zerofill}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[
every head row/.style={before row=\hline,after row=\hline\hline},
every last row/.style={after row=\hline},
every first column/.style={
column type/.add={|}{}
},
every last column/.style={
column type/.add={}{|}
}]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{colortbl}
\pgfplotstabletypeset[
every even column/.style={
column type/.add={>{\columncolor[gray]{.8}}}{}
}]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{booktabs}
\pgfplotstabletypeset[
every head row/.style={
before row=\toprule,after row=\midrule},
every last row/.style={
after row=\bottomrule},
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{booktabs,colortbl}
\pgfplotstabletypeset[
every even row/.style={
before row={\rowcolor[gray]{0.9}}},
every head row/.style={
before row=\toprule,after row=\midrule},
every last row/.style={
after row=\bottomrule},
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[
columns={dof,error1},
outfile=pgfplotstable.example1.out.tex]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[
begin table={
},
typeset cell/.style={
/pgfplots/table/@cell content={
#1 | }
},
before row=
,after row=
,
skip coltypes, typeset=false, string type,
TeX comment=,
columns={level,dof},
outfile=pgfplotstable.example1.out.html,
]{pgfplotstable.example1.dat}
\lstinputlisting
[basicstyle=\ttfamily\footnotesize]
{pgfplotstable.example1.out.html}

[.tex]
[.pdf]
% Requires
% \usepackage{pgfcalendar}
\pgfplotstableset{columns={date,account1}}
% plotdata/accounts.dat contains:
%
% date account1 account2 account3
% 2008-01-03 60 1200 400
% 2008-02-06 120 1600 410
% 2008-03-15 -10 1600 410
% 2008-04-01 1800 500 410
% 2008-05-20 2300 500 410
% 2008-06-15 800 1920 410
% Show the contents in `string type':
\pgfplotstabletypeset[
columns/date/.style={string type}
]{plotdata/accounts.dat}
\hspace{1cm}
% Show the contents in `date type':
\pgfplotstabletypeset[
columns/date/.style={date type={\monthname\ \year}}
]{plotdata/accounts.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[columns={level,dof}]
{pgfplotstable.example1.dat}
\pgfplotstabletypeset[
columns={level,dof},
columns/level/.style={string replace={A}{B}}, % does nothing because there is no 'A'
columns/dof/.style={string replace={256}{-42}}] % replace '256' with '-42'
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstabletypeset[
columns={level},
columns/level/.style={
column name={$2\cdot \text{level}+4$},
preproc/expr={2*##1 + 4}
}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
columns={error1,sqrterror1},
create on use/sqrterror1/.style={create col/copy=error1},
columns/error1/.style={column name=$\epsilon$},
columns/sqrterror1/.style={sqrt,column name=$\sqrt \epsilon$},
sci,sci 10e,precision=3,sci zerofill
}
\pgfplotstabletypeset{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
columns={dof,error2,slopes2},
columns/error2/.style={sci,sci zerofill},
columns/slopes2/.style={dec sep align,empty cells with={\ensuremath{-}}},
create on use/slopes2/.style=
{create col/gradient loglog={dof}{error2}}}
\pgfplotstabletypeset{pgfplotstable.example1.dat}
\pgfplotstabletypeset[columns/slopes2/.append style={multiply -1}]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{booktabs}
\pgfplotstabletypeset[
every head row/.style={
before row=\toprule,after row=\midrule},
every last row/.style={
after row=\bottomrule},
row predicate/.code={%
\ifnum#1>4\relax
\ifnum#1<8\relax
\pgfplotstableuserowfalse
\fi
\fi}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{booktabs}
\pgfplotstabletypeset[
every head row/.style={
before row=\toprule,after row=\midrule},
every last row/.style={
after row=\bottomrule},
skip rows between index={2}{4},
skip rows between index={7}{9}
]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{booktabs}
\pgfplotstableset{
every head row/.style={before row=\toprule,after row=\midrule},
every last row/.style={after row=\bottomrule}}
\pgfplotstabletypeset[string type]{pgfplotstable.example2.dat}
\pgfplotstabletypeset[
display columns/0/.style={select equal part entry of={0}{2},string type},
display columns/1/.style={select equal part entry of={0}{2},string type},
display columns/2/.style={select equal part entry of={1}{2},string type},
display columns/3/.style={select equal part entry of={1}{2},string type},
columns={A,B,A,B}
]
{pgfplotstable.example2.dat}

[.tex]
[.pdf]
% requires \usepackage{eurosym}
\pgfplotstabletypeset[
column type=r,
columns={dof,info},
columns/info/.style={
% stupid example for multiple postprocessors:
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={$\bf}{$},
},
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={}{\EUR{}},
}
}]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
create on use/slopes1/.style=
{create col/gradient loglog={dof}{error1}}}
\pgfplotstabletypeset[
columns={dof,error1,slopes1},
columns/error1/.style={sci,sci zerofill},
columns/slopes1/.style={
postproc cell content/.append code={%
\ifnum\pgfplotstablerow=0
\pgfkeyssetvalue{/pgfplots/table/@cell content}{\ensuremath{-}}%
\fi
}%
}]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% Requires
% \usepackage{pgfcalendar}
% plotdata/accounts.dat contains:
%
% date account1 account2 account3
% 2008-01-03 60 1200 400
% 2008-02-06 120 1600 410
% 2008-03-15 -10 1600 410
% 2008-04-01 1800 500 410
% 2008-05-20 2300 500 410
% 2008-06-15 800 1920 410
\pgfplotstabletypeset[
columns={date,account1},
column type=r,
columns/date/.style={date type={\monthname\ \year}},
columns/account1/.style={fonts by sign={}{\color{red}}}
]
{plotdata/accounts.dat}

[.tex]
[.pdf]
% this key setting could be provided in the document's preamble:
\pgfplotstableset{
% define how the 'new' column shall be filled:
create on use/new/.style={create col/set list={4,5,6,7,...,10}}}
% create a new table with 11 rows and column 'new':
\pgfplotstablenew[columns={new}]{11}\table
% show it:
\pgfplotstabletypeset[empty cells with={---}]\table

[.tex]
[.pdf]
% create a new table with 11 rows and column 'new':
\pgfplotstablenew[
% define how the 'new' column shall be filled:
create on use/new/.style={create col/expr={factorial(15+\pgfplotstablerow)}},
columns={new}]
{11}
\table
% show it:
\pgfplotstabletypeset\table

[.tex]
[.pdf]
\pgfplotstableread{pgfplotstable.example1.dat}\table
\pgfplotstablecreatecol[
create col/assign/.code={%
\getthisrow{level}\entry
\getnextrow{level}\nextentry
\edef\entry{thisrow=\entry; nextrow=\nextentry.
(\#\pgfplotstablerow/\pgfplotstablerows)}%
\pgfkeyslet{/pgfplots/table/create col/next content}\entry
}]
{new}\table
\pgfplotstabletypeset[
column type=l,
columns={level,new},
columns/new/.style={string type}
]\table

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstableset{% could be used in preamble
create on use/quot1/.style=
{create col/quotient={error1}}}
\pgfplotstabletypeset[
columns={error1,quot1},
columns/error1/.style={sci,sci zerofill},
columns/quot1/.style={dec sep align}]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
create on use/my new col/.style={create col/set={--empty--}},
columns/my new col/.style={string type}
}
\pgfplotstabletypeset[
columns={level,my new col},
]{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
create on use/my new col/.style={
create col/set list={A,B,C,4,50,55,...,100}},
columns/my new col/.style={string type}
}
\pgfplotstabletypeset[
columns={level,my new col},
]{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
create on use/new/.style={create col/copy={level}}
}
\pgfplotstabletypeset[
columns={level,new},
columns/new/.style={column name=Copy of level}
]{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
create on use/new/.style={
create col/expr={\thisrow{level}*2}}
}
\pgfplotstabletypeset[
columns={level,new},
columns/new/.style={column name=$2\cdot $level}
]{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstableset{
create on use/new/.style={
create col/expr={\pgfmathaccuma + \thisrow{level}}},
create on use/new2/.style={
create col/expr accum={\pgfmathaccuma * \thisrow{level}}{1}%<- start with `1'
}
}
\pgfplotstabletypeset[
columns={level,new,new2},
columns/new/.style={column name=$\sum$level},
columns/new2/.style={column name=$\prod$level}
]{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstableset{% configuration, for example, in preamble:
create on use/quot1/.style={create col/quotient=error1},
create on use/quot2/.style={create col/quotient=error2},
columns={error1,error2,quot1,quot2},
%
% display styles:
columns/error1/.style={sci,sci zerofill},
columns/error2/.style={sci,sci zerofill},
columns/quot1/.style={dec sep align},
columns/quot2/.style={dec sep align}
}
\pgfplotstabletypeset{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstabletypeset[% here, configuration options apply only to this single statement:
create on use/rate1/.style={create col/dyadic refinement rate={error1}},
create on use/rate2/.style={create col/dyadic refinement rate={error2}},
columns={error1,error2,rate1,rate2},
columns/error1/.style={sci,sci zerofill},
columns/error2/.style={sci,sci zerofill},
columns/rate1/.style={dec sep align},
columns/rate2/.style={dec sep align}]
{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstableset{% configuration, for example in preamble:
create on use/slopes1/.style={create col/gradient loglog={dof}{error1}},
create on use/slopes2/.style={create col/gradient loglog={dof}{error2}},
columns={dof,error1,error2,slopes1,slopes2},
% display styles:
columns/dof/.style={int detect},
columns/error1/.style={sci,sci zerofill},
columns/error2/.style={sci,sci zerofill},
columns/slopes1/.style={dec sep align},
columns/slopes2/.style={dec sep align}
}
\pgfplotstabletypeset{pgfplotstable.example1.dat}

[.tex]
[.pdf]
% requires \usepackage{array}
\pgfplotstableset{% configuration, for example in preamble:
create on use/slopes1/.style={create col/gradient semilogy={level}{error1}},
columns={level,error1,slopes1},
% display styles:
columns/level/.style={int detect},
columns/error1/.style={sci,sci zerofill,sci subscript},
columns/slopes1/.style={dec sep align}
}
\pgfplotstabletypeset{pgfplotstable.example1.dat}

[.tex]
[.pdf]
\pgfplotstablenew[
create on use/cut/.style={create col/function graph cut y=
{2.5e-4}% search for fixed L2 = 2.5e-4
{x=Basis,y=L2,ymode=log,xmode=log}% double log, each function is L2(Basis)
% now, provide each single function f_i(Basis):
{{table=plotdata/newexperiment1.dat},{table=plotdata/newexperiment2.dat}}
},
columns={cut}]
{2}
\table
% Show the data:
\pgfplotstabletypeset{\table}
\begin{tikzpicture}
\begin{loglogaxis}
\addplot table[x=Basis,y=L2] {plotdata/newexperiment1.dat};
\addplot table[x=Basis,y=L2] {plotdata/newexperiment2.dat};
\draw[blue!30!white] (axis cs:1,2.5e-4) -- (axis cs:1e5,2.5e-4);
\node[pin=-90:{$x=53.66$}] at (axis cs:53.66,2.5e-4) {};
\node[pin=45:{$x=601.83$}] at (axis cs:601.83,2.5e-4) {};
\end{loglogaxis}
\end{tikzpicture}

[.tex]
[.pdf]
\pgfplotstablenew[
% same as above...
create on use/cut/.style={create col/function graph cut y=
{2.5e-4}% search for fixed L2 = 2.5e-4
{x=Basis,y=L2,ymode=log,xmode=log,
foreach={\i in {1,2}}{plotdata/newexperiment\i.dat}}%
{}% just leave this empty.
},
columns={cut}]
{2}
\table
% Show the data:
\pgfplotstabletypeset{\table}

[.tex]
[.pdf]
\pgfplotstableread{pgfplotstable.example1.dat}\table
\pgfplotstablemodifyeachcolumnelement{error1}\of\table\as\cell{%
\edef\cell{\#\pgfplotstablerow: \cell}%
}
\pgfplotstabletypeset[columns=error1,string type]{\table}

[.tex]
[.pdf]
\pgfplotstabletypeset[string type]{pgfplotstable.example3.dat}

[.tex]
[.pdf]
\pgfplotstabletranspose\table{pgfplotstable.example3.dat}
\pgfplotstabletypeset[string type]\table

[.tex]
[.pdf]
\pgfplotstabletranspose[colnames from=c]\table{pgfplotstable.example3.dat}
\pgfplotstabletypeset[string type]\table

[.tex]
[.pdf]
\pgfplotstabletranspose[input colnames to=Input]\table{pgfplotstable.example3.dat}
\pgfplotstabletypeset[string type]\table

[.tex]
[.pdf]
\pgfplotstabletranspose[input colnames to=]\table{pgfplotstable.example3.dat}
\pgfplotstabletypeset[string type]\table

[.tex]
[.pdf]
\pgfplotstabletranspose[columns={a,b}]\table{pgfplotstable.example3.dat}
\pgfplotstabletypeset[string type]\table