Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sorry, this question must be utterly stupid, but I am unable to run a TikZ figure script. I have put \usepackage{tikz} in the preamble. But, it gets stuck after the first line in the document:

\begin{tikzpicture}
\begin{axis}[%

-> Environment axis undefined!

I have checked, but there is simply no package named "tikz" on CTAN, Am I checking the wrong spot? My document looks like this:

\documentclass[a4paper,12pt]{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[yscale=1.5]
\begin{tikzpicture}

\begin{axis}[%
width=4.52083333333333in,
height=3.565625in,

...

\end{tikzpicture}
\end{document}

Any help will be greatly appreciated.

share|improve this question
8  
you need \usepackage{pgfplots} which is a package built on top of TikZ for plotting and many other stuff. – percusse Jan 31 at 23:40
You have \begin{tikzpicture} twice. You should delete the second one. You also need to end the axis environment somewhere before the document ends. The axis environment belongs to the pgfplots package. You will need to load that one too. – Count Zero Jan 31 at 23:43
3  
The error you received is also indicative of all the packages you specified having loaded properly. If TikZ wasn't installed you would have received an explicit error: ! LaTeX Error: File tikz.sty not found. – Alan Munn Jan 31 at 23:47

closed as too localized by Alan Munn, Qrrbrbirlbel, diabonas, Martin Schröder, zeroth Feb 3 at 21:29

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.