Skip to main content
added 141 characters in body
Source Link
SquareOne
  • 7.7k
  • 1
  • 17
  • 36

You can also use the option EvaluationMonitor to retrieve the mesh points from Plot and feed them to ListPlot:

myfuncs = {Sin,Cos}; data = Reap[Plot[y = #[t], {t, 0, 2}, PlotPoints -> 20, MaxRecursion -> 1, Mesh -> All, EvaluationMonitor :> Sow[{t, y}]];] & /@ myfuncs // #[[All, 2, 1]] &; ListPlot[Sort /@ data, Joined -> True, PlotMarkers -> Style["\[FilledCircle]", 12], PlotStyle -> ColorData[97, "ColorList"][[2 ;; 3]]] 

enter image description here

(Of course, this solution only makes sense if your interested in the "adaptative sampling" of Plot as already mentioned in the comments.)

You can also use the option EvaluationMonitor to retrieve the mesh points from Plot and feed them to ListPlot:

myfuncs = {Sin,Cos}; data = Reap[Plot[y = #[t], {t, 0, 2}, PlotPoints -> 20, MaxRecursion -> 1, Mesh -> All, EvaluationMonitor :> Sow[{t, y}]];] & /@ myfuncs // #[[All, 2, 1]] &; ListPlot[Sort /@ data, Joined -> True, PlotMarkers -> Style["\[FilledCircle]", 12], PlotStyle -> ColorData[97, "ColorList"][[2 ;; 3]]] 

enter image description here

You can also use the option EvaluationMonitor to retrieve the mesh points from Plot and feed them to ListPlot:

myfuncs = {Sin,Cos}; data = Reap[Plot[y = #[t], {t, 0, 2}, PlotPoints -> 20, MaxRecursion -> 1, Mesh -> All, EvaluationMonitor :> Sow[{t, y}]];] & /@ myfuncs // #[[All, 2, 1]] &; ListPlot[Sort /@ data, Joined -> True, PlotMarkers -> Style["\[FilledCircle]", 12], PlotStyle -> ColorData[97, "ColorList"][[2 ;; 3]]] 

enter image description here

(Of course, this solution only makes sense if your interested in the "adaptative sampling" of Plot as already mentioned in the comments.)

Source Link
SquareOne
  • 7.7k
  • 1
  • 17
  • 36

You can also use the option EvaluationMonitor to retrieve the mesh points from Plot and feed them to ListPlot:

myfuncs = {Sin,Cos}; data = Reap[Plot[y = #[t], {t, 0, 2}, PlotPoints -> 20, MaxRecursion -> 1, Mesh -> All, EvaluationMonitor :> Sow[{t, y}]];] & /@ myfuncs // #[[All, 2, 1]] &; ListPlot[Sort /@ data, Joined -> True, PlotMarkers -> Style["\[FilledCircle]", 12], PlotStyle -> ColorData[97, "ColorList"][[2 ;; 3]]] 

enter image description here