1

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.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Sara
  • 21
  • 1
  • 2

1 Answers1

7

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

Mahdi
  • 1,619
  • 10
  • 23
  • 3
    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. – Fred Simons May 29 '15 at 08:06