Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

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
up vote 15 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

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