PGFPLOTS: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
(Created page with 'PGFPLOTS works in combination with TikZ. It serves the purpose of adding plots. Mainly giving facilities to create very customized axis and read of data points inlined or in exte…')
 
No edit summary
Line 6: Line 6:
PGFPLOT allow to add plots with an exquisite level of sophistication and at the same time keep all the typesetting capabilities. Let alone the capacity of giving the plot the same formatting as the rest of the document, including font type and bibliographical references.
PGFPLOT allow to add plots with an exquisite level of sophistication and at the same time keep all the typesetting capabilities. Let alone the capacity of giving the plot the same formatting as the rest of the document, including font type and bibliographical references.


In order to keep the tutorial short and simple I will concentrate in PGFPLOTS as a replacement for GNUplot.
In order to keep the tutorial short and simple I will concentrate in PGFPLOTS as a replacement for the good GNUplot.

= Basics =


To start using the library, just add this line to the header of a LaTeX document:
To start using the library, just add this line to the header of a LaTeX document:

Revision as of 05:22, 25 August 2010

PGFPLOTS works in combination with TikZ. It serves the purpose of adding plots. Mainly giving facilities to create very customized axis and read of data points inlined or in external files.

In general we think as a plot in a document as a separate part. It is regarded as a figure that we somehow include in the main document, and by tradition it has some arbitrary format independent of that in the document. Moreover due to usual limitations of plotting programs we don't dare to include complicated symbols or formulas in plots. They can't typeset formulas or text properly, but LaTeX could in principle.

PGFPLOT allow to add plots with an exquisite level of sophistication and at the same time keep all the typesetting capabilities. Let alone the capacity of giving the plot the same formatting as the rest of the document, including font type and bibliographical references.

In order to keep the tutorial short and simple I will concentrate in PGFPLOTS as a replacement for the good GNUplot.

Basics

To start using the library, just add this line to the header of a LaTeX document:

\usepackage{pgfplots}

Every plot is part of a tikzpicture (this allows to combine TikZ and PGFPLOTS seamlessly). The main object in PGFPLOTS is the axis.

\begin{tikzpicture}  %every plot is part of a tikzpicture
 \begin{axis}[
 ]
 \addplot 
 \end{axis}