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.

This question already has an answer here:

I want to plot several 2D curves (Sin[x] at y=0, Cos[x] at y=1) in a 3D plot, what function should i use?

f[x_, y_] := Piecewise[{{0, y < 0 || y > 0}, {Sin[x], y == 0}}]
g[x_, y_] := Piecewise[{{0, y < 1 || y > 1}, {Cos[x], y == 1}}]
Plot3D[{f[x, y], g[x, y]}, {x, 0, 10}, {y, 0, 10}]

doesn't work. Any ideas?

share|improve this question
1  
Have you seen ParametricPlot3D[]? –  J. M. May 11 '13 at 6:37
    
In fact a more general question behind this is how to make a waterfall plot. I found some discussions here –  xzczd May 11 '13 at 6:46
    
To avoid analytic geometry, check out Graphics3D: Tube. Sometimes it is more useful. –  Kuba May 11 '13 at 7:24
    
Plot3D draws a surface, you need ParametricPlot3D with one parameter (for a curve) or points for Line and Graphics3D. –  BoLe May 11 '13 at 14:03
add comment

marked as duplicate by J. M. Jun 6 '13 at 4:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 12 down vote accepted
ParametricPlot3D[{{Sin[u], 0, u}, {Cos[u], 1, u}}, {u, 0, 20}, 
 BoxRatios -> 1, PlotRange -> {{-2, 2}, {-.5, 2}, {0, 20}}]

enter image description here

=== update - general thoughts ===

I've seen the comments to this question and a few other approaches to the waterfall (or wire) plot are given in this question: Plotting several functions. Also I cannot not mention one of my favorite Mathematica blogs - Archery with this post on the story of discovery of 1st pulsar and an its infamous graphics - code is given in the post:

enter image description here

share|improve this answer
add comment

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