I have some data of type {{x1, y1, f1}, {x2, y2, f2}, ...}
and want to do ListContourPlot
. However, there is a problem that the data f
is not smooth enough and has small errors.
Here is a toy example illustrating the problem:
data = Flatten[
Table[{i (1 + RandomReal[0.1]), j (1 + RandomReal[0.1]),
i + j}, {i, 0, 100}, {j, 0, 100}], 1];
ListContourPlot[data, Contours -> {80, 120}, ContourShading -> None]
I would need to smooth the lines in the above curve, to get something like
Any ideas to get this kind of smoothed plot? Thanks!
And here is the figure from real data (which is too large to paste here), which I need to smooth:
I find this thread InterpolationOrder for ContourPlot related. But I was unable to get the method work in my case because of (I guess) different input.
Note added:
Thanks a lot for the answers! Those answers works great for the toy example, but for the real data I still cannot get smooth lines so far (edit: so far means before the great guys update their answers ^_^. Now it worked great). Here is my data and plotting function, just in case you would like to give a try. I will also investigate why those interesting methods fail to work when I apply it to data...
https://www.dropbox.com/s/2pgobgrhbo42f4v/contourData.dat
data = << "contourData.dat";
ListContourPlot[data, Contours -> {2.30, 6.18},
ContourShading -> None]
ListPlot[Most /@ data, AspectRatio -> 1]
: i.stack.imgur.com/DgAAh.png vs. i.stack.imgur.com/zfE5C.png). Also, the aspect ratio of the data is very different from the way you're plotting it. $\endgroup$