Skip to content

Instantly share code, notes, and snippets.

@padde
Created June 19, 2012 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save padde/2953741 to your computer and use it in GitHub Desktop.
Save padde/2953741 to your computer and use it in GitHub Desktop.
Mathematica: Export Plot Values as CSV
plot = Plot[Cos[x],{x,0,2\[Pi]}];
mydata = Flatten[Cases[plot, Line[x__] -> x, Infinity], 1];
Export["/Users/padde/Desktop/plot-data.dat", mydata, "CSV"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment