Skip to main content
1 of 5
Yi Wang
  • 7.5k
  • 4
  • 32
  • 39

Smoothing ListContourPlot contours

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] 

enter image description here

I would need to smooth the lines in the above curve, to get something like

enter image description here

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:

enter image description here

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.

Yi Wang
  • 7.5k
  • 4
  • 32
  • 39