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 load an external custom colormap with

\input{coolwarm_.map}

I have a range of complex surface plots created with matlab2tikz which use this colormap and compile successfully. One does not. It fails with this error:

! Package pgfplots Error: No such element: \pgfplotsarrayselect257\of{pgfpl@cm@
matlab}.

I tried the fix given here but it does not work.

You can look at the colormap here.

The working tikzpicture is here.

The non-working tikzpicture is here.

I am wondering if it has anything to do with the plot type; the one that fails is a nearest neighbour interpolation with some very steep surfaces, the other is a cubic interpolation.

EDIT: Yes, this is a clue to the cause -- the other nearest neighbour surface plot in my collection, produced with MATLAB's TriScatteredInterp, produces exactly the same error when using this colormap.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This is due to a bug in pgfplots v1.8 (or earlier). It has already been fixed and will be part of the next stable 1.9.

Pre-release downloads can be retrieved from http://pgfplots.sourceforge.net/

share|improve this answer
    
Thanks for the tip. I'm still puzzled why it happens with the one plot, but not the other, though. What's the nature of the bug? Can you elaborate? –  Stephen Bosch Sep 29 '13 at 17:04
1  
It is related to rounding/interpolation of color values near the upper end of the color map: there was a defect in a check which manifested itsself only under strange circumstances. –  Christian Feuersänger Sep 29 '13 at 17:53
    
The prerelease version of pgfplots does indeed correct the problem. Best of all, my other graphics still compile, too ;) –  Stephen Bosch Sep 29 '13 at 19:06
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.