# ContourPlot not displaying the plot properly

I am having some issues using PlotPoints in ContourPlot. In the following code, depending on the PlotPoints the plot looks very different and having more points doesn't necessarily give the correct plot.

c = 3; f1 = 91.8; f2 = 89.9; A = 56; B = 50;
T12 = (1/(1 + (0.63*A)^2*(Sin[Pi/(x1*10^-9)*c/f1])^2))*(1/(1 + (0.63*B)^2*(Sin[Pi/(x2*10^-9)*c/f2])^2));
Show[ContourPlot[T12, {x1, 941.2, 941.8}, {x2, 941.2, 941.8}, ContourShading -> None, Axes -> False, Frame -> True, Contours -> 50, PlotPoints -> 40, PlotRange -> All]] Plotpoints are 70, 60, 50, 40 from left to right.

• Try to use PerformanceGoal->"Quality" instead of PlotPoints. – demm Jun 9 '16 at 12:48
• @demm that doesn't seem to help – crossingsymmetry Jun 9 '16 at 13:26

## 1 Answer

Your evaluation suffers from loss of precision. Compare instead with the following, where all constants have been made into arbitrary precision numbers, so arbitrary-precision calculations and error-tracking can be used:

c = 3; f1 = 918/10; f2 = 899/10; A = 56; B = 50;

T12 = (1/(1 + (63/100*A)^2*(Sin[Pi/(x1*10^-9)*c/f1])^2))*(1/(1 +
(63/100*B)^2*(Sin[Pi/(x2*10^-9)*c/f2])^2));

ContourPlot[
T12, {x1, 9412/10, 9418/10}, {x2, 9412/10, 9418/10},
ContourShading -> None, Axes -> False, Frame -> True,
Contours -> 50, WorkingPrecision -> 50
] This shows the highest contours clipped; adding PlotRange -> All as you had originally:

ContourPlot[
T12, {x1, 9412/10, 9418/10}, {x2, 9412/10, 9418/10},
ContourShading -> None, Axes -> False, Frame -> True,
Contours -> 50, WorkingPrecision -> 50,
PlotRange -> All
] These seem in keeping with the 3D shape of the expression:

Plot3D[
T12, {x1, 9412/10, 9418/10}, {x2, 9412/10, 9418/10},
PlotRange -> All,
WorkingPrecision -> 50
] 