Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have two lists of data which I am plotting on two ListLinePlots. I would like to have these two plots appear perpendicular to each other on a 3D graphic. I have tried to do this using a modification to the answers to this question, but I am quite new to Mathematica so I had some trouble converting this into code that works for me.

Is there any way that I can implement this method when the data is lists rather than functions of some variable?

share|improve this question
1  
please include your code and some sample data. In short, yes, you can do it. The trick is to not plot it as ListLinePlots, but to do a 3D line plot –  rm -rf Apr 15 '13 at 23:32

1 Answer 1

up vote 6 down vote accepted

When you create a ListLinePlot, you're creating a 2D graphics. What you need to do is to take your 2D list data and plot it in 3D, with an appropriate value chosen for the third coordinate to make them perpendicular. Since you pointed to the EM wave example, I'll demonstrate an example using lists, that partially reproduces my answer there:

data = Table[{x, Sin[x]}, {x, 0, 5 π, π/20}];
ListPointPlot3D[
    {
        data /. {x_?NumericQ, y_?NumericQ} :> {x, y, 0}, 
        data /. {x_?NumericQ, y_?NumericQ} :> {x, 0, y}
    }, 
    PlotStyle -> {Blue, Darker@Green}, AxesOrigin -> {0, 0, 0}, 
    Boxed -> False, Ticks -> None, AxesStyle -> LightGray
] /. Point -> Line

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.