Take the 2-minute tour ×
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.

I am trying to compile a document that uses the tikzpicture and pgf packages, but I am getting this error

enter image description here

UPDATE

Code:

    \begin{tikzpicture} 
    \begin{semilogyaxis}[
         width=0.75\columnwidth,
         xtick={10,20,...,40},
         xlabel=Tamaño del arreglo (miles),
         ylabel=Tiempo (ms),
         legend pos=outer north east,
         title=\textbf{Comparación}]
    \addplot coordinates{(10,100) (20,300) (30,400) (40,600)};
    \addplot coordinates{(10,400) (20,600) (30,200) (40,400)};
    \addplot coordinates{(10,600) (20,500) (30,100) (40,200)};
    \addplot coordinates{(10,600) (20,100) (30,500) (40,100)};
    \addplot coordinates{(10,300) (20,100) (30,200) (40,500)};
    \addplot coordinates{(10,600) (20,200) (30,400) (40,500)};
    \legend{Selección,Inserción,Mezcla,Montículos,Rápido,Residuos}
    \end{semilogyaxis}
\end{tikzpicture}

Latex preamble:

\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{fancyheadings}
\usepackage{chngcntr}
\counterwithout{figure}{section}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\usepgfplotslibrary{units}
\date{}
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

The error message is quite descriptive; you are using some code that requires the calc library, so need to load it; add

\usetikzlibrary{calc}

after

\usepackage{tikz}

Try processing this sample document exactly as it is:

\documentclass{article}
\usepackage{pgfplots}

\begin{document}

    \begin{tikzpicture} 
    \begin{semilogyaxis}[
         width=0.75\columnwidth,
         xtick={10,20,...,40},
         xlabel=Tamaño del arreglo (miles),
         ylabel=Tiempo (ms),
         legend pos=outer north east,
         title=\textbf{Comparación}]
    \addplot coordinates{(10,100) (20,300) (30,400) (40,600)};
    \addplot coordinates{(10,400) (20,600) (30,200) (40,400)};
    \addplot coordinates{(10,600) (20,500) (30,100) (40,200)};
    \addplot coordinates{(10,600) (20,100) (30,500) (40,100)};
    \addplot coordinates{(10,300) (20,100) (30,200) (40,500)};
    \addplot coordinates{(10,600) (20,200) (30,400) (40,500)};
    \legend{Selección,Inserción,Mezcla,Montículos,Rápido,Residuos}
    \end{semilogyaxis}
\end{tikzpicture}

\end{document}

From the comments (and a discussion in chat) it was clear that the problem was an outdated LaTeX system.

share|improve this answer
    
Thanks that fixed one thing, however I keep getting: -Package pgfkeys Error and Missing \begin{document} –  metroxylon Sep 4 '12 at 1:25
    
What's the complete error message you are getting? Can we see the complete TikZ code producing the error? –  Gonzalo Medina Sep 4 '12 at 1:26
    
\usepgfplotslibrary {groupplots} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. –  metroxylon Sep 4 '12 at 1:30
    
Updated screenshot: Screenshot –  metroxylon Sep 4 '12 at 1:31
    
The last line refers to legend pos which suggests that you are using the pgfplots package. Did you load this package? –  Gonzalo Medina Sep 4 '12 at 2:00
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.