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.

In order to include a cross through the origin in my plot, I write the following under \begin{axis}:

extra x ticks={0},
extra y ticks={0},
extra tick style={grid=major},

However, the 0s appear in bold face in my plot. How can I prevent this?

share|improve this question
2  
Can you please include a simple example? Make sure that it is not printed twice that might create an illusion. –  percusse Jun 1 '12 at 15:10
    
Your code-snippet doesn't demonstrate the problem- please make a complete MWE –  cmhughes Jun 1 '12 at 15:26
    
For getting zero lines in your plot, take a look at How can I add a zero line to a plot? –  Jake Jun 1 '12 at 15:29
    
I just noticed that you seem to be using Joseph Wright's solution from the question I linked to. You forgot to also use the option extra y tick labels=,, which switches off the labels for the extra ticks. –  Jake Jun 1 '12 at 15:32
    
Yes, I noticed that Joseph Wright's example was similar, but didn't notice the line turning off the extra tick labels (I also didn't understand that that was the reason for the boldface-looking 0s). Thanks! –  andreasdr Jun 1 '12 at 16:13

1 Answer 1

up vote 2 down vote accepted

You're printing the labels twice, once with the regular ticks, once with the extra x ticks and extra y ticks, which looks as if they're printed bold. You'll need to switch the extra labels off, by using extra y tick labels={} and extra x tick labels={}.

\documentclass{article}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    extra x ticks={0}, extra x tick labels={},
    extra y ticks={0}, extra y tick labels={},
    extra tick style={grid=major},
]
\addplot{rand};
\end{axis}
\end{tikzpicture}

\end{document}
share|improve this answer

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.