-1
$\begingroup$

This is my code

ContourPlot[{y^4 - 3 x*y^2 + x^3}, {x, -2.5, 2.5}, {y, -2, 2}, 
 Contours -> {Automatic, 50}, BoundaryStyle -> Directive[Red, Thick], 
 ContourShading -> None, Axes -> True, AxesLabel -> {x, y}, 
 PlotRange -> {{-3, 3}, {-2.5, 2.5}}, 
 LabelStyle -> Directive[Blue, Bold], Frame -> False]

enter image description here

And I want to insert following points (color=green and thick):

P1=(1.5,1.5)
P2=(1.5,-1.5)

Each point shall be be labeled with the value:

-1.6875

This value shall be visible in the Plot.

$\endgroup$
  • $\begingroup$ Also related: 22305 $\endgroup$ – Mahdi May 29 '15 at 7:59
5
$\begingroup$

You could use Epilog, something like:

pts = {{1.5, 1.5}, {1.5, -1.5}};
ContourPlot[{y^4 - 3 x*y^2 + x^3}, {x, -2.5, 2.5}, {y, -2, 2}, 
 Contours -> {Automatic, 50}, BoundaryStyle -> Directive[Red, Thick], 
 ContourShading -> None, Axes -> True, AxesLabel -> {x, y}, 
 PlotRange -> {{-3, 3}, {-2.5, 2.5}}, 
 LabelStyle -> Directive[Blue, Bold], Frame -> False, 
 Epilog -> { PointSize[0.05], Green, Point[#] & /@ pts, Black, 
   Text["-1.6875", #] & /@ pts}]

Result:

enter image description here

| improve this answer | |
$\endgroup$
  • 3
    $\begingroup$ Though not exactly the question, I prefer Epilog -> {Green, PointSize[0.02], Tooltip[Point[{{1.5, 1.5}, {1.5, -1.5}}], -1.6785]}]. The green points then behave exactly like the contour lines: the value appears when the mouse is over them. $\endgroup$ – Fred Simons May 29 '15 at 8:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.