I'm trying to extract the data from a parametric plot via the following:
Subscript[\[Epsilon], e] = 0.0005; Subscript[R, 0] = 15; f[\[Theta]_, \[Phi]_] := 1 + (4 Subscript[\[Epsilon], e])/(1 - 3 Subscript[\[Epsilon], e]) (Cos[\[Theta]]^4 + Sin[\[Theta]]^4 (1 - 2 Sin[\[Phi]]^2 Cos[\[Phi]]^2)); x = Subscript[R, 0] (f[\[Theta], \[Phi]] Sin[\[Theta]] Cos[\[Phi]] + D[f[\[Theta], \[Phi]], \[Theta]] Cos[\[Theta]] Cos[\[Phi]] - (D[ f[\[Theta], \[Phi]], \[Phi]] Sin[\[Phi]])/Sin[\[Theta]]); y = Subscript[R, 0] (f[\[Theta], \[Phi]] Sin[\[Theta]] Sin[\[Phi]] + D[f[\[Theta], \[Phi]], \[Theta]] Cos[\[Theta]] Sin[\[Phi]] + (D[ f[\[Theta], \[Phi]], \[Phi]] Cos[\[Phi]])/Sin[\[Theta]]); z = Subscript[R, 0] (f[\[Theta], \[Phi]] Cos[\[Theta]] - D[f[\[Theta], \[Phi]], \[Theta]] Sin[\[Theta]]); Now, Parametric2D gives me the desired figure.
ParametricPlot[{x, y}, {\[Theta], 0, 2 \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotStyle -> None, MeshFunctions -> {#3 &}, Mesh -> {{{\[Pi]/2, Directive[Opacity[1], Blue, Thick]}}}] Next I need to save the data, and I do the following
data = Cases[ ParametricPlot[{x, y}, {\[Theta], 0, 2 \[Pi]}, {\[Phi], 0, 2 \[Pi]}, PlotStyle -> None, MeshFunctions -> {#3 &}, Mesh -> {{{\[Pi]/2, Directive[Opacity[1], Blue, Thick]}}}], Line[data_] :> data, -4, 1][[1]]; SetDirectory[NotebookDirectory[]]; Export["Groov_pro_Diff_THAf.txt", data, "Table"] Through the above code, although I generate a txt file, I get the error
Part1 of {} does not exist I have no issues with the plot, ParametricPlot[...] command gives me the correct figure, but not during saving the data. Here I would like to save the data as two columns only. Can anyone suggest how to extract the data in such a case?