About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

A Sample Plot (pgfplots.sty)

\documentclass{article}

\usepackage{pgfplots}

\usetikzlibrary{plotmarks}% required for the "diamond*" plot mark

\pgfplotsset{compat=1.11}

\begin{document}

\begin{tikzpicture}
\begin{axis}[xtick=data,% use x data for tick marks
 xlabel=Year,ylabel={Profits (\pounds)},% axes labels
 title={Profits Since 2010},% plot title
 x tick label style={% change x tick label style
  /pgf/number format/set thousands separator={}%
 },
 tick align=outside,% ticks on the outside
 scaled ticks=false,% don't scale the tick labels
 axis lines*=left
 ]
\addplot[mark=diamond*,mark size=5pt,thick,cyan] table 
{
  year profit
  2010 52000
  2011 50000
  2012 75000
  2013 60000
};
\end{axis}
\end{tikzpicture}

\end{document}

Download pgfplots-sample.tex or pgfplots-sample.pdf.

© 2015 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs