Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
    ]
        %\addplot[mark=none] table[x=BE,y=cnts] {si2p.txt};
        % This data looks similar:
        \addplot[mark=none, smooth] table[x=BE,y=cnts] {
            BE      cnts
            95      1
            98      1
            99      10
            99.5    5
            100 6
            101 2
            108 2
        };

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

enter image description here

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.

enter image description here

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

share|improve this question
    
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. –  Peter Grill Jan 13 '13 at 1:10
1  
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. –  Qrrbrbirlbel Jan 13 '13 at 12:10
    
@PeterGrill, ok I added a table, so everyone can compile it. –  quinmars Jan 13 '13 at 12:40
    
@Qrrbrbirlbel, indeed, good catch. –  quinmars Jan 13 '13 at 12:47

1 Answer 1

up vote 9 down vote accepted

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).

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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