# How to make the tick thickness as the axis line?

I am trying to make the thickness of the ticks equal to the axis line thickness. That is what I have so far:

\documentclass{article}

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

\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel=Binding Energy (eV),
ylabel=Intensity (a.\,u.),
xtick pos=left,
x dir= reverse,
ytick = \empty,
every x tick/.style={color=black, thin},
tick align=outside,
xlabel near ticks,
ylabel near ticks,
xmin = 96,
xmax = 108
]
% This data looks similar:
BE      cnts
95      1
98      1
99      10
99.5    5
100 6
101 2
108 2
};

\end{axis}
\end{tikzpicture}
\end{document}


But if you take a closer look on the ticks on the outside, you'll see that they are somehow clipped or a least thinner. They are also black so the style seems to work for them.

Is this a bug or can I change the clipping region? And as a second question: is thin the correct value for the thickness?

• Thank you for providing a MWE. But you should also ensure that it will be compilable by others. In this case, others do not have access to your table of data so can't compile it as is. Also, since this problem is really not related to the actual data, you could just use a few fixed points for the graph in the MWE. Jan 13, 2013 at 1:10
• The tick lines are, in fact, clipped. One can check with xshift=-.5\pgflinewidth. Then the last tick line is clearly seen in full-width. Jan 13, 2013 at 12:10
• @PeterGrill, ok I added a table, so everyone can compile it. Jan 13, 2013 at 12:40
• @Qrrbrbirlbel, indeed, good catch. Jan 13, 2013 at 12:47

This is probably a bug in pgfplots. In fact, it was meant to be a feature that a huge line width of a tick label does not extend to the left or right of an axis. It should respect the line width of the axis lines, though.

If this is urgent, I can send you a patch for your version which deactivates the feature (by mail, you can find my address in the pgfplots manual).

UPDATE: this will be fixed as of pgfplots 1.11 (not released at the time of this writing). As soon as it is released, you will need to write \pgfplotsset{compat=1.11} to activate it (I do not want to modify bounding boxes in existing figures - that way, it applies only to new documents).

• No it's not urgent. I just started to layout my PhD thesis, but I'm far from writing it. Thanks Jan 13, 2013 at 22:07
• Any solution for this yet? May 21, 2013 at 13:56
• I am hitting the same behavior; is there some workaround?
– Koji
Oct 3, 2013 at 8:26
• @quinmars: Dirty, dirty workaround: \def\pgfplots@drawticklines@INSTALLCLIP@onorientedsurf#1{}% \def\pgfplots@drawgridlines@INSTALLCLIP@onorientedsurf#1{}%
– Koji
Oct 3, 2013 at 9:27