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.

With the risk of sounding foolish, but I can't seem to find the answer anywhere. How can I set the ticklabels for the colorbar? Let's say I have the following code:

\documentclass{report}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
    \begin{figure}          
        \begin{tikzpicture}     
            \begin{axis}[%
                xmin=1, xmax=2,
                ymin=1, ymax=2,
                colorbar,point meta min=0.3,point meta max=5.5]
            \addplot [color=black]
            coordinates{(1,1)(2,2)};
            \end{axis}
        \end{tikzpicture}
    \end{figure}
\end{document}

You'll notice the labels for the colorbar are 1, 2, 3, 4 and 5. What if I would want for instance the random 0.3, 0.6, 1, ... , 5.5?

Cheers!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Section 4.8.12 of the pgfplots manual explains how to configure the colorbar style. In your case, that's

colorbar style={ ytick={0.3, 0.6, 1, 5.5} }
share|improve this answer
    
So simple, nice! Thanks. –  Blaatschaap Aug 29 '12 at 9:34
add comment

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.