Mathematica Plot 3D in Mathematica: Getting Coordinates for Points

AI Thread Summary
To extract coordinates from a 3D Plot in Mathematica, the use of the Reap and Sow functions is essential. The provided code snippet demonstrates how to plot a function while simultaneously capturing the coordinates of the points plotted. By utilizing the EvaluationMonitor option with Sow, the coordinates of each point, along with their corresponding function values, can be collected. The final output can be accessed using Reap, which retrieves the stored coordinates. This method effectively allows for the extraction of all plotted points from a 3D visualization in Mathematica.
gaby287
Messages
14
Reaction score
0
I have a 3D Plot in Mathematica and I would like to get coordinates for points (all points) that were plotted.
 
Physics news on Phys.org
Reap[
Print[Plot3D[x^2 y + y^2 x + 2, {x, -1, 1}, {y, -1, 1}, EvaluationMonitor :> Sow[{x, y, x^2 y + y^2 x + 2}]]]
][[2, 1]]

Note, despite it not being particularly that there is a : followed by > in that.
 

Similar threads

Back
Top