opts = {ImageSize -> 500, PlotRange -> {{-5, 15}, All}, PlotPoints -> 84,
MaxRecursion -> 9, MeshFunctions -> {Cos[#1] - (1/2)^#1 &}, Mesh -> {{0}},
MeshStyle -> {Directive[Red, PointSize[Large]]}};
You may be interested in the fact that Mesh
solution is good for visulatisation purposes but it seems that coordinates given with this method are only approximation.
Also there are double points, one for each curve and each aproximation is independent what may result in different coordinates.
Taking your example let's label those points:
(Plot[{Cos[x], (1/2)^x}, {x, -1, 11}, Evaluate@opts] // Normal
) /. Point[x_] :> ({Point@x,
Text[Style[NumberForm[#, {Infinity, 2}], Bold, Black, 15] &@x
, x + {0, .5 - RandomReal[]/2}]})
It basically replaces points with points + labels. Labels are with random offset so you can see what I was reffering to. Normal
is in order to get rid of the GraphicsComplex
.
As you can see, the mesh point near $y$ axis has different coordinates :)
Edit So at the end I would use NSolve
based solution like in the first link you've provided:
After all I forgot you asked for the legend next to the plot :)
points = {x, Cos[x]} /. NSolve[Cos[x] == (1/2)^x && -1 < x < 11, x];
names = FromCharacterCode /@ (Range[Length@points]+96)
{"a", "b", "c", "d", "e"}
Row[{
Plot[{Cos[x], (1/2)^x}, {x, -1, 11}, Evaluate@opts,
Epilog -> (Text[Style[#, 20], #2 + {0, .2}] & @@@ Transpose[{names, points}])
]
,
Grid@MapThread[List, {names, points}]
}]
Graphics[Text[#, #] & /@ coords]
to theShow
or justText
part to theEpilog
. $\endgroup$Text
, it's positioned next to the point itself, not on top of it. $\endgroup$Text
as suggested to get only relevant info. $\endgroup$