I am starting playing with plots in latex.
In my preample I have:
\usepackage{pgfplots}
\pgfplotsset{width=12cm,compat=1.9}
My plots code: (first is copy from from tutorial, second is my attempt)
\begin{tikzpicture}
\begin{axis}[xlabel=Cost,ylabel=Error]
\addplot[color=red,mark=x] coordinates {
(2,-2.8559703)
(3,-3.5301677)
(4,-4.3050655)
(5,-5.1413136)
(6,-6.0322865)
(7,-6.9675052)
(8,-7.9377747)
};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[ymin=0, ymax=12, xtick={25,50,75,100,125,150}, grid=major, xlabel=x label,
ylabel=ylabel]
\addplot[color=blue,mark=x] coordinates {
(25,1)
(50,1.87)
(75,2.79)
(100,3.78)
(125,4.83)
(150,5.83)
};
\addlegendentry{legend 1}
\addplot[color=black,mark=o] coordinates {
(25,1)
(50,2.91)
(75,4.27)
(100,5.91)
(125,7.82)
(150,9.00)
};
\addlegendentry{legend 2}
\end{axis}
\end{tikzpicture}
And result:

My question is: Why my plot do not have line between ticks? Am I missing something?
EDIT:
I am using Ubuntu 13.10 with Kile 2.1.3.
I downloaded PGFPlots 1.9 from sourceforge and pointed TEXINPUTS system variable to its location.
I am posting full document. It produces pdf with content identical to image posted above. First plot has lines between marks, second does not. (preamble is pretty large, because it will be my master thesis)
\documentclass[a4paper,oneside,12pt]{report}
\usepackage[OT4]{polski}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{indentfirst}
\usepackage{titlesec}
\usepackage{nameref}
\usepackage{zref-user,zref-lastpage}
\usepackage{fancyhdr}
\usepackage{listings}
\usepackage{enumerate}
\usepackage{pgfplots}
\pgfplotsset{width=12cm,compat=1.9}
%listings configuration
\lstset{
language=SQL,
basicstyle=\small\sffamily,
numbers=left,
numberstyle=\tiny,
frame=tb,
columns=fullflexible,
showstringspaces=false
}
\onehalfspacing
\titleformat*{\section}{\normalsize\bfseries}
\setlength{\parindent}{1cm}
\begin{document}
\pagestyle{plain}
\begin{tikzpicture}
\begin{axis}[xlabel=Cost,ylabel=Error]
\addplot[color=red,mark=x] coordinates {
(2,-2.8559703)
(3,-3.5301677)
(4,-4.3050655)
(5,-5.1413136)
(6,-6.0322865)
(7,-6.9675052)
(8,-7.9377747)
};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[ymin=0, ymax=12, xtick={25,50,75,100,125,150}, grid=major, xlabel=x label,
ylabel=ylabel]
\addplot[color=blue,mark=x] coordinates {
(25,1)
(50,1.87)
(75,2.79)
(100,3.78)
(125,4.83)
(150,5.83)
};
\addlegendentry{legend 1}
\addplot[color=black,mark=o] coordinates {
(25,1)
(50,2.91)
(75,4.27)
(100,5.91)
(125,7.82)
(150,9.00)
};
\addlegendentry{legend 2}
\end{axis}
\end{tikzpicture}
\end{document}
pgfplots 1.8and the marks are connected with lines in the second plot. My wild guess is that you are using an older version of pgfplots and it gets confused by thecompat=1.9command in the preamble (?) – alfC Nov 24 '13 at 10:06pgfplotsincompat. – m0nhawk Nov 24 '13 at 10:08pgfplots 1.9(I have TeXLive 2013 through Fedora and it still uses1.8). – alfC Nov 24 '13 at 10:11pgfplots, so either the one in Fedora isn't updated, or you haven't updated it (withtlmgr). (CTAN has 1.9, and both the systems I mentioned sync with CTAN.) – Torbjørn T. Nov 24 '13 at 12:39\listfilesjust before\documentclassyou will get a list of all packages used, and their version, near the end of the.logfile. Can you remove all packages that doesn't influence the problem, and then also provide that list of packages? – Torbjørn T. Nov 24 '13 at 14:52