I'd like to plot a function of one real and one integer variable, but I don't want them all shown in the same 2-D plot - I'd like to see them as separate curves so I can see both "axes", more like how Plot3D works. I'm sure Mathematica can do this, but how?

Edit: Rephrased, I'd like to Plot3D a function of one real and one integer variable. Instead of seeing a surface, I'd like a discrete set of curves in three space.

5 Answers
5

Placing the “wires” on integer values is also easy – see example below. For the range {y, -7, 5} there are 13 integers so you need to ask for 11 wires Mesh -> 11 (in red) because 2 are taken by boundary (blue). With such settings "wires" fall exactly on integer values.

I'm curious to the reason Evaluate is there. Is it required?
–
BeauGesteFeb 6 '12 at 21:02

8

@BeauGeste No, it's not required, but it makes the function evaluate faster and the graphs are plotted in different colours. This has to do with the fact that ParametricPlot3D (as well as all other members of the Plot family) has attribute HoldAll which means that without Evaluate the Table expression would be reevaluated for every value of x. With Evaluate the Table is expanded into an explicit list before it is used by ParametricPlot3D making the evaluation much faster.
–
HeikeFeb 6 '12 at 21:11

Once upon a time, old versions of Mathematica had a package called Graphics`Graphics3D`, which featured a neat little utility called StackGraphics[] that did exactly what OP wanted. Since the current versions of Mathematica no longer support this package, we are lucky that the upgrading information in the help file features some code for mimicking the functionality of StackGraphics[], which you can easily adapt to your circumstances:

Of course, if your Plot[]s use the ColorFunction option, stacking graphics is a bit more complicated, since the output internally uses a GraphicsComplex[] object as opposed to a plain Jane Line[]. In that case, something like the following has to be done:

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.