My question is motivated by the following discussion.

Smoothing ListContourPlot contours

I need to generate high-quality contour plots for some property generated on a non-rectangular grid. This is how my grid looks like:

enter image description here

data set

As an example, let's just plot one contour:

data = Import["/path/to/file", "Table"];
density = data[[All, {1, 2, 4}]];
crd1 = {0., 1.196175};
crd2 = {0., -3.588525};
cnvtAtoAU = 1.889726;
shift = ((crd1[[2]] - crd2[[2]])/2 - crd1[[2]])*cnvtAtoAU;
data = {# + {0, shift, 0, 0}} & /@ data //. {x_List} :> x;

cntrValue = 0.000006;
intOrder = 3;
pr = {{-7, 7}, {-11, 11}, {0, 1}};

density = data[[All, {1, 2, 4}]];
dencntr = ListContourPlot[density,
InterpolationOrder -> intOrder,
Contours -> {cntrValue},
PlotRange -> pr,
ContourShading -> None,
ContourStyle -> Black,
ImageSize -> 500,
AspectRatio -> 1.47,
MaxPlotPoints -> 150]

This produces the following output:

enter image description here

Observe that at first glance the plot looks OK, but at a closer look it has tiny distortions and artifacts that I want to get rid of. I am OK even if the solution does not perfectly coincide with the current curve as long as it is perfectly smooth. As I said, I need a high-quality plot for illustrative purpose.

enter image description here

I tried techniques mentioned in the link above. None of them worked for me. I tried playing with MaxPlotPoints and InterpolationOrder, no success. I also played with Interpolation and splines (achieved nothing).

I was also thinking about transforming data to a different system of coordinates and interpolating it.

Any ideas?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.