1
$\begingroup$

I have a list made out of points {x,y[x]} which I'm plotting using ListLinePlot. I would like to highlight two point and plot a big dot (marker) on them with different color, lets take two point, for example, x=4 highlighted with the color yellow, and x=20 with the color red. The model:

n = 100;
f[x_] = x^0.5 + 4;
ListLinePlot[Table[{x, f[x]}, {x, 1, n}]]

Any help?

$\endgroup$
1
  • 1
    $\begingroup$ ListLinePlot[Table[{x, f[x]}, {x, 1, n}], Epilog -> {AbsolutePointSize[6], Yellow, Point[{4, f[4]}], Red, Point[{20, f[20]}]}] $\endgroup$
    – Bob Hanlon
    May 13, 2021 at 19:58

2 Answers 2

3
$\begingroup$
ListLinePlot[Table[{x, f[x]}, {x, 1, n}], 
 Mesh -> {{{4, Yellow}, {20, Red}}},
 BaseStyle -> AbsolutePointSize[10] ]

enter image description here

$\endgroup$
1
$\begingroup$

Or...

ListLinePlot[Table[{x, f[x]}, {x, 1, n}],
 Epilog -> {PointSize[.05], 
            Point[{4, f[4]}], 
            Point[{40, f[40]}]}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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