TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to replicate this colormap in TiKz or pgfplots. Let me clarify, I don't need a plot of any kind, these are screen-shots from another application. But since the labels on the pic below are poor I'd like to make it more professional.

enter image description here

So far I have this rubbish:

enter image description here

Is there a way to cut out the adjoining plot altogether and put my own tick labels on the contour?


 \begin{axis}[hide axis,colorbar,colormap/jet,
  colorbar style={yshift=-2cm,
    yticklabel pos=left,
    yticklabel style={anchor=south},},

share|improve this question
up vote 13 down vote accepted

You can make the axis take up no space by setting scale only axis, width=0pt, height=0pt, hide axis.

To be able to set the range of the colorbar, you have to provide a dummy plot. Then you can set point meta min and point meta max to control the range:

    hide axis,
    scale only axis,
    colorbar horizontal,
    point meta min=18,
    point meta max=45,
    colorbar style={
    \addplot [draw=none] coordinates {(0,0)};

share|improve this answer
Fantastic! Thank you very much Jake! Is it possible to make the colours discrete? – HCAI Jun 20 '13 at 11:37
@HCAI: Sure. Just set colorbar sampled before colorbar horizontal, and then set samples=<number> in the colorbar style. – Jake Jun 20 '13 at 11:45
Super! One other question, since the the colorbar is an axis in its own right, can you change its size without adding more gradations? – HCAI Jun 20 '13 at 11:47
@HCAI: You can change the width in the colorbar style options. That doesn't affect the number of samples. Is that what you mean? – Jake Jun 20 '13 at 14:22

Your Answer


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.