# How do I place points along the curves in a plot?

I'm trying to place points on these functions

Manipulate[
Plot[{a^x, b^x}, {x, -10, 10},
PlotRange -> {{-3, 3}, {-2, 15}}],
{a, 3, 10, 1},
{b, 2, 11, 1},
{c, 3, 10, 1}]


and control the number of points along the function with a slider using manipulate. I've managed to write out this function, somehow, but I'm relatively new to Mathematica and don't know where to start.

For example, when the 3rd slider is at 0, there should be 0 points. When its at 1, there should be 1 point in the middle of the graph. This should change to 2 evenly spaced points on each function when the slider is 2, and so on.

• This + Epilog + Point.
– Kuba
Apr 20, 2016 at 15:08

## 1 Answer

Why not use Mesh to add points on the curve:

Manipulate[
Plot[{a^x, b^x}, {x, -10, 10}, PlotRange -> {{-3, 3}, {-2, 15}},
Mesh -> 2 p, MeshStyle -> Directive[PointSize[0.02], Red]], {a, 3, 10, 1},
{b, 2, 11, 1}, {{p, 4}, 0, 100, 1}]


• Beat me to it! From the OP's description, I would set it to Mesh->2p so that when p=2 there are 2 points on each curve. Apr 20, 2016 at 15:23
• @JasonB, good point. Thanks Apr 20, 2016 at 15:23
• Thanks! This was really helpful. Apr 20, 2016 at 21:16
• @RileyMorgan. You're welcome, glad I could help. Apr 20, 2016 at 21:33