# Export StreamPlot to tikz

I have a table that I use to generate a streamplot using the command ListStreamPlot. I would like somehow to export the plot to a tikz file. This is because I will need to do some post-processing and I want to make sure that every figure in the paper is consistent (all the other plots are rendered with PGFPlots).

I could not find a smart way to achieve this. How can I extract the data from the plot so that I can embed them in a tikz file?

Thank you

## 1 Answer

(* fake data *)
data = Table[{-1 - x^2 + y, 1 + x - y^2}, {x, -3, 3, .2}, {y, -3, 3, .2}];
(* create plot *)
g = ListStreamPlot[data];
(* get all the arrows *)
c = Cases[g, Arrow[__], 6]
(* create the data *)
dataAsString = ExportString[c /. {Arrow -> Catenate}, "CSV"]

• This is simple and effective. Outstanding! – sbozzolo Jun 5 '18 at 15:36