Mathematica: How to obtain data points plotted by 3Dplot command? -
i've been using command posted years ago here how obtain data points 2d-function:
f = sin[t]; plot = plot[f, {t, 0, 10}] points = cases[ cases[inputform[plot], line[___], infinity], {_?numericq, _?numericq}, infinity];
and export data file:
export["data2/name_"<>tostring[n[index]]<>"&"<>tostring[n[a]]<>".dat",points1,"table","fieldseparators"->" "];
however, right must generalize command 3dplot case, i've tried @ documentation cases , list3dplot commands unfortunately have not been able figure out. has suggestion? i'd appreciate lot. thanks.
using cases
:
flatten[cases[ inputform@normal@plot3d[sin[x y], {x, -1, 1}, {y, -1, 1}] , polygon[x_, ___] -> x, infinity], 1] // union
using evaluationmonitor
:
reap[plot3d[z = sin[x y], {x, -1, 1}, {y, -1, 1}, evaluationmonitor :> sow[{x, y, z}]]][[2, 1]];
Comments
Post a Comment