2

In traditional textbooks you'll see open and closed dots to indicate whether to include or exclude the point respectively. How can I modify this code to include open and closed dots at x=2? I don't see any options available in Plot.

Plot[Piecewise[{{.5 (x - 2)^2 + 4, x < 2}, {1, x >= 2}}], {x, -2, 5}]

I'm looking for something like below. I'm hoping to avoid manually adding dots using Graphics Point and then specify the exact coordinates. This is a pain. Is there a faster way?

enter image description here

B flat
  • 5,523
  • 2
  • 14
  • 36

1 Answers1

3
Plot[Piecewise[{{.5 (x - 2)^2 + 4, x < 2}, {1, x >= 2}}], {x, -2, 5},
 Epilog -> {
   PointSize[0.03], Blue, Point[{2, 1}],
   PointSize[0.02], White, Point[{2, 1}],
   PointSize[0.03], Blue, Point[{2, 4}]},
 Exclusions -> 2,
 PlotTheme -> "Detailed"]

enter image description here

eldo
  • 67,911
  • 5
  • 60
  • 168