# ContourPlot does not find contours that RegionPlot finds

For a function I am plotting I can get a RegionPlot[f[x, y] > 100] but if I do ContourPlot[f[x, y], Contours -> {1, 10, 100, 1000}] in the same $x$ and $y$ ranges, only the contours for 1 and 10 are drawn, not the ones for 100 and 1000. I know that these two contours exists because RegionPlot finds them, so, what options of ContourPlot should I use to get the plot done?

For an example please try ContourPlot[0.000157223 10^(2 x - 2 y), {x, -6, -1}, {y, -6, -1}, Contours -> { 100}, ContourShading -> False]

• So, um, can I see what f looks like? :-) Mar 24, 2016 at 16:01
• try PlotPoints Mar 24, 2016 at 16:02
• @JasonB The specific f I have today is something you do not want to look at :) it comes from a long manipulation of inputs. Mar 24, 2016 at 16:07
• Roberto, as you can see, we are shooting blind here. We need to have access to the function, or even better, to a minimal working example that exhibits the same problem, to provide meaningful help. Mar 24, 2016 at 16:15
• Interestingly, ContourPlot[0.000157223 10^(2 x - 2 y) == 100, {x, -6, -1}, {y, -6, -1}] does plot the contour.
– user484
Mar 24, 2016 at 16:32

Ah, what's happening is that the contour you want is outside the automatically chosen PlotRange. Observe:

ContourPlot[0.000157223 10^(2 x - 2 y), {x, -6, -1}, {y, -6, -1}] The contour you want would be in the white part, whose values are extremely high compared to the automatically drawn contours. Instead you have to force the PlotRange to contain the contour, for example by setting it to All:

ContourPlot[0.000157223 10^(2 x - 2 y), {x, -6, -1}, {y, -6, -1}, Contours -> {100},
ContourShading -> None, PlotRange -> {Full, Full, All}] • Thanks for posting as answer! (+1) Mar 24, 2016 at 16:53

Working blind.. here is a little trick to let you visualize where ContourPlot evaluates your function and help you find appropriate settings for PlotPoints and MaxRecursion. I think MaxRecursion doesn't help if it doesn't even spot the countour on first pass.

cv = 3/4;
Show[
MapAt[Graphics[{If[#[] > cv, Red, Blue],
Point[#[[1 ;; 2]]]} & /@ #[]] &,
Reap[ContourPlot[  (fv = Sin[x] Cos[y]) == cv ,
{x, -4, 4}, {y, -4, 4},
EvaluationMonitor :> Sow[{x, y, fv}],
MaxRecursion -> 2, PlotPoints -> 5]], {2}]] cv = 100;
Show[
MapAt[Graphics[{If[#[] > cv, Red, Blue],
Point[#[[1 ;; 2]]]} & /@ #[]] &,
Reap[ContourPlot[
fv = 0.000157223 10^(2 x - 2 y), {x, -6, -1}, {y, -6, -1},
Contours -> {1, 10, 100, 1000},
EvaluationMonitor :> Sow[{x, y, fv}], you see it is finding the contours just fine so it seems like a glitch in contourshading. (I tried playing with ContourStyle with no success )

As noted by @Rahul in comments this works:

ContourPlot[ 0.000157223 10^(2 x - 2 y) == {1, 10, 100,  1000},
{x, -6, -1}, {y, -6, -1}] ContourPlot[0.00015 10^(2 x - 2 y), {x, -6, -1}, {y, -6, -1}, 