1

Say I want to plot this

Plot[x,Sin[x],{x,0,4 Pi}]

And I want it to show 4 nicely spaced points, on the line. Is there an automatic way to do this?

I was reading this, but it's not in Mathematica forum and I can't comment because I dont have enough reputation. One of the answer is this

{plot, {points}} = Reap @ Plot[Last@Sow@{x, Sin[x]}, {x, 0, 4 Pi}]

This look like the closest thing to it, but I got this, as a return: enter image description here

Probably my mistake, but should the point {x,Sin[x]} be part of the points? I am running MMA10.0.1 X64 on windows 7 SP1.

How do I use the points obtained there, to add onto the original plot? Is there a more efficient way?

Thanks!

Chen Stats Yu
  • 4,986
  • 2
  • 24
  • 50

1 Answers1

3

You can use the answer from 39394

Plot[Sin[x], {x, 0, 4 Pi}, Mesh -> 4 , MeshStyle -> {PointSize[Large]}]

enter image description here

Zviovich
  • 9,308
  • 1
  • 30
  • 52