6

I'm seeing x tick marks drawn outside the plot area when ybar is active. Is this expected, why, and how can it be prevented?

Here's a MWE:

\documentclass{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.10}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
    title=Test,
    xlabel={X label},
    ylabel={Y label},
    ybar
]
\end{axis}
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}[
    title=Test,
    xlabel={X label},
    ylabel={Y label},
    %ybar
]
\end{axis}
\end{tikzpicture}

\end{document}

ybar

7

Yes, this is by design. It makes sense to align the tick marks on the outside of the plot area, since especially the bottom ones are otherwise easily hidden by the columns of the plot (unless you're using axis on top, that is).

If you want the tick marks to be aligned on the inside of the plot area, set xtick align=inside.

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.