I need to center the axes in the coordinate origin. The axes not center, can see axis y extend (circle red).

Ty for help me :D


...

\pgfplotsset{compat=1.11}

...

\begin{document}

\begin{tikzpicture}[scale=1.5]
  \begin{axis} [
    xlabel = \textit{Voltage},
    ylabel = \textit{Current},
    axis lines = middle,
    enlarge y limits = true,
    xmin = 0, xmax = 90,
    ymin = 0, ymax = 150,
    width=15cm, height=8cm,
    grid = major,
    grid style = {dashed, line width=.1pt, draw=gray!30},
    legend pos = north east,
    ]

    \addplot table[x index = {0}, y index = {1}]{\mydata};
    \legend{Townsend}

  \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

up vote 3 down vote accepted

Your problem is simply the option enlarge y limits, which you should set to false instead of true.

  • Ty, as has not gave me account u.u – Luis Rivera Feb 8 '17 at 9:08

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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