# Trouble with pgfplots and ubuntu [duplicate]

This question already has an answer here:

Using writelatex (because I was at work where I had to use a windows machine which did not have a working Latex setup) I was able to produce some relatively nice-looking graphics using pgfplots.

My laptop runs Ubuntu 12.04 LTS and has every TexLive package installed and seemingly working well. Looking at the Ubuntu package manager this would seem to include pgfplots via texlive-pictures.

Still when I run this stripped-down version of an example I was trying to create:

\documentclass{amsart}

\usepackage{graphicx}
\usepackage{pgfplots}
\pgfplotsset{width=\textwidth,height=\textheight}

\begin{document}

\begin{tikzpicture}
\begin{axis}[hide axis,enlargelimits=false]
\addplot[black,domain=0:2*360,samples=360]
{cos(x)};
\addplot[black,domain=0:2*360,samples=360]
{-cos(x)};
\addplot+[blue, only marks,mark=*, domain=90:630,samples=4]
{0};

\end{axis}
\end{tikzpicture}

\end{document}


I get this abomination:

If you can't tell, the desired picture is supposed to be of smooth intertwining cosine graphs with the intersection points marked and without any axes or legend.

I see from googling around that there are some potential problems installing pgfplots, but supposedly if it's already installed I should be in the clear. So what's the problem?

## marked as duplicate by cmhughes, texenthusiast, Svend Tveskæg, ChrisS, karlkoellerFeb 25 '14 at 5:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• Are the LaTeX packages coming from the original ubuntu repositories? I think in 12.04 they were pretty old (TL2009). Please check the dates using \listfiles in the very first line of your main document. – Johannes_B Feb 24 '14 at 13:49
• I saw that these were indeed pretty old so I upgraded them as in askubuntu.com/questions/163682/… but kile is still using the 2009 repositories and nothing has changed. – user13352 Feb 24 '14 at 14:10
• I guess you can tweak the kile preferences. Was there a new texmf tree generated? – Johannes_B Feb 24 '14 at 14:11

## 1 Answer

I've discovered that the problem is solved not merely by upgrading texlive as suggested in the above comments, but by doing a full apt-get install texlive-full .

I can only speculate on why upgrading is insufficient but I guess it just downloads the files into a folder which might not be connected to anything else. I can also only speculate as to why the old version of pgfplots creates such a terrible image, but I don't dare.

Thanks everyone for the comments which pointed me towards a solution!