# Contour graph curve intersection

How do I show intersecting points on a contour graph? I have 2 functions graphed but I cannot figure out how to show the points of their intersections.

• Please be more specific: you have the expression of f and g? If you want the intersection of the 2 graphs, try to plot f - g = 0. – youyou May 12 at 18:05

f[x_, y_] := Abs[Sin[x] Sin[y]] - .5
g[x_, y_] := Abs[Cos[x] Cos[y]] - .25


Three alternative methods:

1. Use Solve to find the intersections and add the intersection points as Epilog in ContourPlot:

intersections = {x, y} /.
Solve[{f[x, y] == 0, g[x, y] == 0, -3 <= x <= 3 && -3 <= y <= 3}, {x, y}];

ContourPlot[{f[x, y] == 0, g[x, y] == 0}, {x, -3, 3}, {y, -3, 3},
PlotLegends -> "Expressions",
Epilog -> {Red, PointSize[Large], Point@intersections}] 2. Use GraphicsMeshFindIntersections to find the intersections of contour lines and add the corresponding points using a combination of options Epilog and DisplayFunction:

ContourPlot[{f[x, y] == 0, g[x, y] == 0}, {x, -3, 3}, {y, -3, 3},
PlotLegends -> "Expressions",
DisplayFunction -> (Show[#, Epilog -> {Red, PointSize[Large],
Point@GraphicsMeshFindIntersections[#[], GraphicsMeshAllPoints -> False]}] &)] 3. Use the options MeshFunctions and Mesh:

ContourPlot[{f[x, y] == 0, g[x, y] == 0}, {x, -3, 3}, {y, -3, 3},
PlotLegends -> "Expressions",
MeshFunctions -> {g[#, #2] - f[#, #2] &},
Mesh -> {{{0, Directive[Red, PointSize[Large]]}}}] Note: The last two methods do not work if some contours are tangent to each other.