labels = Style[#, 20] & /@ {"Region 1", "Region 2"};
colors = ColorData[97] /@ {1, 2};
positions = {{7, 7} / 10, {1, 1} / 4};
ContourPlot[{(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 == 8},
{x, -4, 4}, {y, -4, 4},
PlotLegends -> ( Placed[Style@##2, #] & @@@ Transpose[{positions, labels, colors}])]
Alternatively, you can replace PlotLegends -> ...
with
Epilog -> (Text[Style[##2], Scaled@#] & @@@ Transpose[{positions, labels, colors}])
to get the same picture.
Update: You can also get positions
using ImplicitRegion
and RegionCentroid
:
contours = {(x - 2)^2 + (y - 2)^2 == 12, (x + 2)^3 + (y + 2)^3 == 8} ;
positions = Quiet @ N @ RegionCentroid[ImplicitRegion[# /.
Equal -> LessEqual, {{x, -4, 4}, {y, -4, 4} }] ] & /@ contours
{{1.46315, 1.46315}, {-2.03791, -2.03791}}
Notes: (1) Despite the warning message (suppressed above with Quiet
) RegionCentroid
gives the correct coordinates. (2) If you use this with Epilog
you should remove Scaled
.