6

I wrote this simple code for a basic plot (two lines):

Plot[{4, 0}, {x, -2, 2},   
 PlotStyle -> {{Red, Dashed, Thickness[0.004]}, {Red, Dashed, 
    Thickness[0.004]}}, PlotRange -> {-1, 6}]

Whose output is simply

enter image description here

I would like to insert a single point (and moreover, I would like that that point were clearly visible, quite marked) for example the point $P = (1, 4)$ on the red higher line.

How can I do that?

Enrico M.
  • 961
  • 1
  • 6
  • 15

2 Answers2

12
Plot[{4, 0}, {x, -2, 2},
 Epilog -> {Blue, PointSize@Large, Point[{1, 4}]},
 PlotStyle -> {{Red, Dashed, Thickness[0.004]}, {Red, Dashed, Thickness[0.004]}},
 PlotRange -> {-1, 6}]

enter image description here

eldo
  • 67,911
  • 5
  • 60
  • 168
12

Another option is to use Show and Graphics, as in

p = Plot[{4, 0}, {x, -2, 2},PlotStyle -> {{Red, Dashed, Thickness[0.004]}, {Red, Dashed, 
      Thickness[0.004]}}, PlotRange -> {-1, 6}];
g = Graphics[{PointSize[Large], Blue, Point[{1, 4}]}];
Show[p, g]

Mathematica graphics

Nasser
  • 143,286
  • 11
  • 154
  • 359