This is driving me mad. I am tryng to create some contour plots, but I get them full of labels, so that they are unreadable! I can't even see the lines or read the values because they are too much. I just formatted the numeric output from my script, so that the code I am placing here is not really nice. Anyway, I can get the right contour but I would like to have ONLY ONE label on each contour line, not N. I couldn't find any solution on pgfplots manual. Here is my code:
\begin{tikzpicture}
\begin{axis}
[xlabel=$x$,
ylabel=$y$,
width=0.48\columnwidth,
view={0}{90},
ymin=0, ymax=70
]
\addplot3
[contour gnuplot,
thick
]
coordinates {
.....
};
\end{axis}
\end{tikzpicture}
I did not post the coordinates because my file was more than 1000 lines. Any idea? Thanks in advance
contour/label distance
to a value greater than the default of200pt
. Maybe you could try creating a smaller sample of your data that reproduces the undesired behaviour, then we could attempt a more targeted solution.label distance
key to customize its result as indicated by @Jake (however, the initial value is70pt
). If you only want one label per contour line, you can setcontour gnuplot={label distance=10000pt}
. Pgfplots will always generate one label. You can also disable labels usingcontour gnuplot={labels=false}
.