I have 2D data $f(x,y)$ and would like to get a plot along either of the axes, i.e. $f(x_0,y)$ or $f(x,y_0)$.
twoDdata = Table[{x, y, Cos[y ] Sin[x]}, {x, 0, 2 \[Pi], \[Pi]/20}, {y, 0,
2 \[Pi], \[Pi]/20}];
ListDensityPlot[Flatten[twoDdata, 1], ColorFunction -> "Rainbow", PlotLegends -> Automatic]
what is the best way to get a line plot along the black and brown lines in the Fig above?
here is my idea for the brown one
ListLinePlot[twoDdata[[30]][[All, {2, 3}]]]
How can we do it similarly but along the black line? Are there more elegant ways to do that?