PGFPlots on sourceforge

PGFPlots - A LaTeX package to create plots.

Snapshots of the manuals for Version 1.3

Here are snapshots of the developer version manuals, compiled at December 11, 2009. They contain everything which will be available in version 1.3:

Pgfplots Developerversion Manual of Dec 11, 2009

PgfplotsTable Developerversion Manual of Dec 11, 2009

Version 1.2.2 has been released!

We invite you to browse the manuals linked on this page. They contain a lot of examples and images.
LaTeX package pgfplots:
Creating plots in LaTeX [example]
LaTeX package pgfplotstable:
Loading, rounding and formatting tables in LaTeX [example] [example data]

Component of pgfplots
Please refer to http://sourceforge.net/projects/pgfplots/ for download information and latest releases.

Related stuff

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 plot[id=filesuffix] gnuplot{(-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]
\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 plot [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{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}
\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 expression {x^2 + 4}; \addplot expression {-5*x^3 - x^2}; \end{axis} \end{tikzpicture}

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

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

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

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

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

[.tex] [.pdf]
\begin{tikzpicture} \begin{semilogyaxis} \addplot plot[id=exp,domain=0:10] gnuplot{exp(x)}; \end{semilogyaxis} \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]
\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]
\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} \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}[baseline] \begin{axis} \addplot+[only marks] expression[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} \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} \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] expression[domain=-5:0] {4*x^2 - 5}; \addplot+[jump mark right] expression[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} \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, y label style={yshift=0.7cm}, 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 plot[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] expression[samples=400] {rand}; \end{axis} \end{tikzpicture}

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

[.tex] [.pdf]
\begin{tikzpicture} \begin{axis} \addplot+[scatter] expression[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}; % 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] expression[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] expression[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] expression[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] plot[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}
\begin{tikzpicture} \begin{axis}[scatter/classes={ 0={mark=square*,blue},% 1={mark=triangle*,red},% 2={mark=o,draw=black,fill=black}}] % Assumes datafile.dat looks like % x y label % 5.000000e-01 7.500000e-01 1 % 1.000000e+00 6.718750e-01 2 % 1.000000e+00 5.597630e-01 2 % 5.000000e-01 1.250000e-01 2 % 1.000000e+00 6.603350e-01 0 % 5.000000e-01 0.000000e+00 0 % 0.000000e+00 5.000000e-01 0 % 1.000000e+00 0.000000e+00 2 % 5.000000e-01 1.250000e-01 1 % 1.000000e+00 6.213180e-01 1 % ... \addplot[scatter,only marks] table[scatter src=explicit symbolic,x index=x,y index=y,meta=label] {datafile.dat} ; \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] expression[scatter src=y,samples=40] {sin(deg(x))}; \end{axis} \end{tikzpicture}

[.tex] [.pdf]
\begin{tikzpicture} \begin{axis}[ width=10cm, height=210pt, xmin=-4.7124, xmax=4.7124, ymin=-10, ymax=10, xtick={-4.7124,-1.5708,...,10}, xticklabels={$-\frac32 \pi$,$-\pi/2$,$\pi/2$,$\frac32 \pi$}, axis x line=center,axis y line=center, no markers, samples=100] % Use gnuplot as calculator here. The first two plots won't be counted: \addplot gnuplot[id=tan0,forget plot,domain=-1.5*pi+0.003:-0.5*pi-0.003] {tan(x)}; \addplot gnuplot[id=tan1,forget plot,domain=-0.5*pi+0.003: 0.5*pi-0.003] {tan(x)}; \addplot gnuplot[id=tan2, domain= 0.5*pi+0.003: 1.5*pi-0.003] {tan(x)}; \legend{$\tan(x)$} \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] expression[samples=500] {sin(deg(x))}; \addplot[orange] expression[samples=7] {sin(deg(x))}; \addplot[teal,const plot] expression[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] plot[scatter src=y,domain=0:8,samples=100] {exp(x)}; \end{axis} \end{tikzpicture}

[.tex] [.pdf]
\begin{tikzpicture} \begin{axis}[colormap/bluered] \addplot+[scatter] expression[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{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}[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]
\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]
% \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] expression[samples=500] {sqrt(x)} \closedcycle; \addplot[pattern=crosshatch, pattern color=blue!30!white, draw=blue!30!white] expression {x^2} \closedcycle; \addplot[red] coordinates {(0,0) (1,1)}; \legend{$\sqrt x$,$x^2$,$x$} \end{axis} \end{tikzpicture}

[.tex] [.pdf]
\begin{tikzpicture} \begin{axis}[ xlabel=$x$,ylabel=$\sin x$] \addplot[blue,mark=none] expression[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] expression[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] expression[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] expression[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] plot[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] expression[ 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] plot[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] expression[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] plot[domain=-4:4,samples=20] expression{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}[normalsize, title=A ``normalsize'' figure, xlabel=The $x$ axis, ylabel=The $y$ axis, 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, 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, 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}[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] \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] \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] \addplot expression[domain=1:10000] {x^-2}; \end{loglogaxis} \end{tikzpicture} \hspace{1cm} \begin{tikzpicture} \begin{loglogaxis}[axis equal=true] \addplot expression[domain=1:10000] {x^-2}; \end{loglogaxis} \end{tikzpicture}

[.tex] [.pdf]
\begin{tikzpicture} \begin{axis}[axis equal image=false] \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] \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] \addplot expression[domain=1:10000] {x^-2}; \end{loglogaxis} \end{tikzpicture} \hspace{1cm} \begin{tikzpicture} \begin{loglogaxis}[axis equal image=true] \addplot expression[domain=1:10000] {x^-2}; \end{loglogaxis} \end{tikzpicture}

[.tex] [.pdf]
\begin{tikzpicture} \begin{axis} \addplot plot[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 plot[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 plot[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} [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}

[.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}[ 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}[ 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}[ 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}[ 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 plot[id=pow2] gnuplot {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{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}[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 plot coordinates { (0, 65535) (13, 65535) (14, 65536) (15, 65537) (30, 65537) }; \end{axis} \end{tikzpicture}

[.tex] [.pdf]
\begin{tikzpicture} \begin{axis}[ xtick=data,ytick=data, xtick align=center, axis x line=center, axis y line=center, 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}[ xtick=data,ytick=data, axis x line=bottom, ytick align=outside, 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}[ 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{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]
\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]
\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]
% requires \usetikzlibrary{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]
\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\relax \ifnum\coordindex<11\relax \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{loglogaxis}[ 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] plot[forget plot] table {plotdata/oldexperiment1.dat}; \addplot[black!15] plot[forget plot] table {plotdata/oldexperiment2.dat}; \addplot[black!15] plot[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]
\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{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 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]
\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={}, end 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}} \pgfplotstabletypeset[ columns/date/.style={string type} ]{plotdata/accounts.dat} \hspace{1cm} \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]
\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={ 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]
% 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}}{100}} } \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 \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}