# Using Mesh in ContourPlot to find intersections not working

This old answer by @Silvia uses Mesh to find intersections of curves. Unfortunately, it doesn't seem to work in v13.2. For example (based on @JasonB's comment to that answer):

Clear[f, g]
f[x_, y_] := -Cos[y] + 2 y Cos[y^2] Cos[2 x];
g[x_, y_] := -Sin[x] + 2 Sin[y^2] Sin[2 x];

ContourPlot[{f[x, y] == 0, g[x, y] == 0}, {x, -7/2, 4}, {y, -9/5, 21/5},
MeshFunctions -> {f[#1, #2] - g[#1, #2] &}, Mesh -> {{0}},
MeshStyle -> Directive[Red, PointSize[Large]]]


There should be red points at the intersections. Any thoughts on how to get this working? What changed?

• I also test v11.3 (work),v12.3( not work) , Something must be changed in v12. Dec 23, 2022 at 8:40

We can use two MeshFunctions  {f[#1, #2] &, f[#1, #2] - g[#1, #2] &}
ContourPlot[{f[x, y] == 0, g[x, y] == 0}, {x, -7/2, 4}, {y, -9/5,

• Even a dummy first function like MeshFunctions -> {0 #1 &, f[#1, #2] - g[#1, #2] &} seems to work. Dec 23, 2022 at 3:36
• @ChrisK It is also curious to me that {0 &, f[#1, #2] - g[#1, #2] &} also work. Dec 23, 2022 at 3:48