2

In the following MWE the minor ticks are not drawn to the end of the axes but stop at last major tick (at x=1.5 and at y=100).

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{
    compat = 1.15,
    minor tick num = 4
}

\begin{document}

\begin{tikzpicture}
    \begin{axis}
        \addplot
            table {
                x   y
                0.0 100
                1.5 10
            };
    \end{axis}
\end{tikzpicture}

\end{document}

missing minor ticks

Could this be due to a bug in the pgfplots package? How could I force the minor ticks to be drawn to the end of the axes?

EDIT: The minor ticks are drawn as expected using version 1.14 of pgfplots. (I installed version 1.14, just setting compat = 1.14 did not work.)

2

Help pgfplots by providing the axes limits, e. g. \begin{axis}[ymax = 110]. Not in every diagram you want the ticks to be drawn to the very end of the axes.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{
    compat = 1.15,
    minor tick num = 4
}

\begin{document}

\begin{tikzpicture}
    \begin{axis}
        [
        ymax = 110,
        ]
        \addplot
            table {
                x   y
                0.0 100
                1.5 10
            };
    \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

Have a look at the manual for more information.

enter image description here

  • @torbjørn-t (tex.stackexchange.com/users/586/torbj%C3%B8rn-t) Did you edit the answer? I edited it the same time and now don't know what you indented. – Dr. Manuel Kuehner Aug 13 '17 at 16:29
  • As you can see from the revision history, I only removed the quote formatting (> at beginning of line) for the first paragraph of text. It's not a quote, so I don't understand why you used it. – Torbjørn T. Aug 13 '17 at 17:17
  • @TorbjørnT. I see. I just like the appearance. I sometimes see others (mis)use the quote to highlight something. – Dr. Manuel Kuehner Aug 13 '17 at 17:38
  • 1
    Well, I'm not going to go into an editing war with you, but I do think it's wrong, and would suggest that you don't use it like that. (But that's just my opinion.) – Torbjørn T. Aug 13 '17 at 18:06
  • Thanks a lot for the hint! It works. Since I have quite a large number of pgfplots in my document, setting all axis limits manually is a bit cumbersome. Do you have an idea how I could help pgfplots to set the limits more generally? At the moment I do this with the enlargelimits key and its variants. – luki Aug 13 '17 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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