[Tex/LaTex] Set origin of y axis to 1

pgfplotsplottikz-pgf

How to set the origin of y axis to 1?

Minimal example:

\documentclass{article} 
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}

\begin{figure}    
\centering
\begin{tikzpicture}
       \begin{axis}[%
            ,xlabel=$N$
            ,ylabel=speedup
            ,axis x line=bottom
            ,axis y line=left
            ,scaled x ticks=base 10:-3
            ]
            \addplot[very thick] coordinates {(755,1.4) (1978, 1.6) (6273, 1.8) (12222, 2.1)};
            \addplot[very thick, color=blue] coordinates {(6273, 0.2) (12222, 1.2)};
        \end{axis}
\end{tikzpicture}
\caption{Speedup of distributed execution, versus serial. N is the leading dimension of the matrix. The black plot is for the case of one computer, while the blue one is for two computers.}
\label{plot:speedup}
\end{figure}

As we see in figure \ref{plot:speedup} ...

\end{document}

EDIT:

ymin=1 will set the axis to 1, but the value below 1 won't be displayed! ymin=1000 hides all the values!

Best Answer

Is this what you want?

% arara: pdflatex
% arara: pdflatex

\documentclass{article} 
\usepackage{pgfplots}
\pgfplotsset{compat=1.9} % update to 1.12 if possible!
\pgfplotsset{%
    axis line origin/.style args={#1,#2}{
        x filter/.append code={ % Check for empty or filtered out numbers
            \ifx\pgfmathresult\empty\else\pgfmathparse{\pgfmathresult-#1}\fi
        },
        y filter/.append code={
            \ifx\pgfmathresult\empty\else\pgfmathparse{\pgfmathresult-#2}\fi
        },
        xticklabel=\pgfmathparse{\tick+#1}\pgfmathprintnumber{\pgfmathresult},
        yticklabel=\pgfmathparse{\tick+#2}\pgfmathprintnumber{\pgfmathresult}
    }
}

\begin{document}    
    \begin{figure}    
        \centering
        \begin{tikzpicture}
        \begin{axis}[%
        ,xlabel=$N$
        ,xmax=13000
        ,ylabel=speedup
        ,axis x line=middle
        ,axis y line=left
        ,axis line origin={0,1}
        ,scaled x ticks=base 10:-3
        ]
        \addplot[very thick] coordinates {(755,1.4) (1978, 1.6) (6273, 1.8) (12222, 2.1)};
        \addplot[very thick, color=blue] coordinates {(6273, 0.2) (12222, 1.2)};
        \end{axis}
        \end{tikzpicture}
        \caption[Speedup of distributed execution, versus serial]{Speedup of distributed execution, versus serial. N is the leading dimension of the matrix. The black plot is for the case of one computer, while the blue one is for two computers.}
        \label{plot:speedup}
    \end{figure}

    As we see in figure \ref{plot:speedup} ...  
\end{document}

enter image description here