Mathematica: How to obtain data points plotted by plot command?

后端 未结 7 1806
[愿得一人]
[愿得一人] 2021-01-30 15:34

When plotting a function using Plot, I would like to obtain the set of data points plotted by the Plot command.

For instance, how can I obtain the list of points {t,f} P

7条回答
  •  旧时难觅i
    2021-01-30 15:41

    Here is a very efficient way to get all the data points:

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

提交回复
热议问题