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.

This forum has often been of a great help for me, but i never posted myself. So please excuse me, if i won't stick to every formality here perfectly. I will do my best. I hope it's ok that i have 3 different questions on one plot.

I try to create a surface plot by means of \addplots3[surf] and a coordinate table of the form x y z. Whereas x is a more or less continous variable, y contains only 10 columns representing 10 different functions of x. z is nothing but an intensity which i want to display via a color map.

My source code is the following

 \documentclass{article}
\usepackage{pgfplots}
\usepackage{tikz}
\pagestyle{empty}

\pgfplotstableread{carvon-contour.txt}\carvon

%data are of the form
%
%282.7  1   0.0007976728
%282.7  2   0.0007010106
%282.7  3   0.0002862722
%282.7  4   0.0010733289
%282.7  5   0.0004453488
%282.7  6   0.0005347549
%282.7  7   0.0006696946
%282.7  8   0.0008733782
%282.7  9   0.0005243997
%282.7  10  0.0005450571
%282.740201005  1   0.0008267864
%282.740201005  2   0.0007236548
%282.740201005  3   0.0002901354
%282.740201005  4   0.0011133781
%282.740201005  5   0.0004554805
%282.740201005  6   0.0005512185
%282.740201005  7   0.0006887026
%282.740201005  8   0.000905994
%282.740201005  9   0.0005406747
%282.740201005  10  0.0005593566
%...

\begin{document}

\begin{tikzpicture}
    \begin{axis}
    [
        view={0}{90},
        colormap/bluered,
        minor x tick num=3,         
        xmin=283.8,
        xmax=289.3,
        minor y tick num=0,
        ymin=0,
        ymax=11,
        colorbar
  ]
    \addplot3[surf, mesh/cols=10, shader=flat] table {\carvon};
\end{axis}
\end{tikzpicture}

\end{document}

Whereas the output is this:

As one can see the plot displays only 9 of 10 columns. Can someone see a reason for that?

Now, the colormap ranges from 0 to about 0.28 just as the data do, but somehow the colors of the plot only reach to about 0.16 (yellow). Does pgfplots perform kind of a binning so that peak values of greater than 0.2 are averaged to lower values? Or did i miss something else? And most important: how to get rid of it?

Last but not least: As i said before, the x-axis is continious, whearas y is not. Is there a way of interpolating the data along the x-axis in order to obtain a smoother curve, but not along the y-axis at the same time? shader=interp interpolates in both directions.

Thanks for your help!!

share|improve this question

closed as unclear what you're asking by Jubobs, Guido, Werner, Peter Jansson, Heiko Oberdiek Apr 12 at 21:25

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Ok, all 3 issues had the same origin. Of course, pgfplots uses 2 values along the y-axis for one polygon. One row within the plot belongs to 2 neighbouring columns of my data. This has different effects: 1. –  user25485 Feb 4 '13 at 19:38
    
i am sorry, i sent my comment accidentally and wasn't fast enough with editing it. here is what i intended to write: "This has different effects: 1. there are just 9 pairs, (1 and 2, 2 and 3, ..., 9 and 10); 2. the color for one row arises from the average of both columns (don't mix up my column and row here. by row i mean the graph and by column my data); 3. i created 2 columns per row now (at 0.5 and 1.5 for the former column 1...) and every row is its own plot. now i can use shader=interp as well. Thanks for reading this nonetheless" –  user25485 Feb 4 '13 at 19:46
3  
I think it would be good if you would post your answer such that it is of use to others. Or are there open issues? –  Christian Feuersänger Feb 5 '13 at 22:00

Browse other questions tagged or ask your own question.