3
$\begingroup$

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?

$\endgroup$
1
8
$\begingroup$
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

$\endgroup$
1
  • $\begingroup$ Awesome again! Easy and fast, thank you so much! $\endgroup$
    – xyzt
    Dec 9 '15 at 20:58
11
$\begingroup$

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

$\endgroup$

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