Difference between revisions of "Pgfplot"

From Wiki
Jump to navigation Jump to search
(uploaded processed example)
Line 11: Line 11:
 
(Data on low-temperature thermal expansion coefficients downloaded from [http://cryogenics.nist.gov/]).
 
(Data on low-temperature thermal expansion coefficients downloaded from [http://cryogenics.nist.gov/]).
  
<context source="yes">
+
<texcode>
 
\setupcolors[state=start]
 
\setupcolors[state=start]
 
\usemodule[tikz]
 
\usemodule[tikz]
Line 37: Line 37:
 
         \stopaxis
 
         \stopaxis
 
\stoptikzpicture
 
\stoptikzpicture
</context>
+
</texcode>
  
{{todo|Download data files or locally processed result.}}
+
[[Image:Pgfplot_example.png]]
  
 
[[Category:Modules]]
 
[[Category:Modules]]
 
[[Category:Graphics]]
 
[[Category:Graphics]]
 
[[Category:Math]]
 
[[Category:Math]]

Revision as of 15:52, 26 January 2009

< Modules | Graphics | Math >

Pgfplots is a data plotting package based on PGF/TikZ. It is now included as a (third party) module for ConTeXt (with TikZ)

An alternative package is MPgraph using MetaPost.

Example

(Data on low-temperature thermal expansion coefficients downloaded from [1]).

\setupcolors[state=start]
\usemodule[tikz]
\usemodule[pgfplots]

\starttikzpicture
        \startaxis[     xmin=0,xmax=300,
                        title=http://cryogenics.nist.gov/,
                        xlabel=$T$ (K),
                        ylabel=$(L-L_{293})/L_{293}$,
                        legend style={at={(0.95,0.05)},anchor=south east},
                        width=16cm ]
                \addplot[mark=none,color=red] plot file {sapphire.dat};
                \addlegendentry{sapphire}
                \addplot[mark=none,color=green] plot file {Be.dat};
                \addlegendentry{Be}
                \addplot[mark=none,color=blue] plot file {BeCu.dat};
                \addlegendentry{BeCu}
                \addplot[mark=none,color=cyan] plot file {SS304.dat};
                \addlegendentry{SS304}
                \addplot[mark=none,color=magenta] plot file {Al6061-T6.dat};
                \addlegendentry{Al6061-T6}
                \addplot[mark=none,color=orange] plot file {nylon.dat};
                \addlegendentry{nylon}
        \stopaxis
\stoptikzpicture

Pgfplot example.png