[Tex/LaTex] Stretch y-axis in pgfplots

pgfplots

I'm using pgfplots for simple plotting 2-dimensional data from a plain datatable file. What i try is to "stretch" the y-axis by a factor (say currently i have stretched it by factor '1' which is the standard and i want to modify that factor (im my case increase it a bit))

Here is a minimal working example:

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

\begin{center}

\begin{tikzpicture}
\begin{axis} [
 xmode = log,
 log basis x=2,
 ytick={2,...,7},
 xlabel={Input size $n$},
 ylabel={time per input in $s$},
 grid=major,
 grid style={densely dotted},
 legend style={at={(0.425,0.99)},
 anchor=north,legend columns=2}
 ]
 ]

 \addplot table[x = size, y expr= \thisrow{time}/(\thisrow{size}/1024)] {
 size time 
 1048576   1024
 8388608   2048
 67108864  4096
 536870912 8192
 };
\end{axis}
\end{tikzpicture}

\end{center}

\end{document}

I'm looking for a as easy as possible solution which also works in the beamer environment.

Best Answer

There's an axis option called y post scale for this:

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
%\pgfplotsset{compat=1.7}
\begin{document}

\begin{tikzpicture}
\begin{axis} [
 xmode = log,
 log basis x=2,
 ytick={0,0.5,1},
 xlabel={Input size $n$},
 ylabel={time per input in $s$},
 grid=major,
 grid style={densely dotted},
 legend style={at={(0.425,0.99)},
 anchor=north,legend columns=2},
 ]


 \addplot table[x = size, y expr= \thisrow{time}/(\thisrow{size}/1024)] {
 size time 
 1048576   1024
 8388608   2048
 67108864  4096
 536870912 8192
 };
 \end{axis}
 \end{tikzpicture}

\begin{tikzpicture}
\begin{axis} [
 xmode = log,
 log basis x=2,
 ytick={0,0.5,1},
 xlabel={Input size $n$},
 ylabel={time per input in $s$},
 grid=major,
 grid style={densely dotted},
 legend style={at={(0.425,0.99)},
 anchor=north,legend columns=2},
 y post scale=1.4
 ]


 \addplot table[x = size, y expr= \thisrow{time}/(\thisrow{size}/1024)] {
 size time 
 1048576   1024
 8388608   2048
 67108864  4096
 536870912 8192
 };
 \end{axis}
 \end{tikzpicture}

 \end{document}