Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

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 ContourPlotInterpolationOrder 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] 

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.

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] 

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.

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] 
edited tags
Link
Alexey Popkov
  • 62.5k
  • 7
  • 163
  • 405
added 88 characters in body
Source Link
Yi Wang
  • 7.5k
  • 4
  • 32
  • 39

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.

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] 

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.

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. 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] 

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.

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] 
Tweeted twitter.com/#!/StackMma/status/453217133796020224
added 518 characters in body
Source Link
Yi Wang
  • 7.5k
  • 4
  • 32
  • 39
Loading
Source Link
Yi Wang
  • 7.5k
  • 4
  • 32
  • 39
Loading