# How to plot multiple 3D plots on the same graphic [closed]

This is the code that I was able to make

h[x_]:= x^2; a = 1; b = 5; n = 5; dx = b-a/n;


Those are my parameters

Table[ParametricPlot3D[{(a + i*dx) Cos[t], (a + i*dx) Sin[t], h},
{t, 0, 2Pi}, {h, 0, h[a + i*dx]}], {i, 1, n}]


But I can't manage to plot them on the same graphic, I am trying to use the DiscretePlot3D function but I need more input for my code, I don't know what I am doing wrong.

DiscretePlot[[Table[ParametricPlot3D[{(a + i*dx) Cos[t],(a + i*dx) Sin[t], h},
{t, 0, 2 Pi}, {h, 0, h[a + i*dx]}], {i, 1, n}]], {Table, 1, n}]


Some help would be really appreciated.

## closed as off-topic by Pillsy, ybeltukov, MarcoB, user9660, m_goldbergNov 9 '15 at 17:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Pillsy, ybeltukov, MarcoB, Community, m_goldberg
If this question can be reworded to fit the rules in the help center, please edit the question.

• Your code has a syntax error, with the second bracket after DiscretePlot. – Pillsy Nov 9 '15 at 15:11
• How about using GraphicsGrid[Table[...]]? – egwene sedai Nov 9 '15 at 15:12
• Rasterize[ GraphicsRow[ Table[ParametricPlot3D[{(a + i*dx) Cos[t], (a + i*dx) Sin[t], h}, {t, 0, 2 Pi}, {h, 0, h[a + i*dx]}], {i, 1, n}]], ImageSize -> 800, ImageResolution -> 1200] – egwene sedai Nov 9 '15 at 15:15

f[a_, b_, n_, s_] := # {Cos@t, Sin@t, s #} &@(a + #*(b - a/n)) & /@  Range@n

p[a_, b_, n_] := ParametricPlot3D[f[a, b, n, s], {t, 0, 2 Pi}, {s, 0, 1},
PlotRange -> b n {{-1, 1}, {-1, 1}, {0, b n}},
PlotStyle -> ({Opacity[# /10 ], Hue[#]} & /@ (n/Range@n)),
Mesh -> None, Evaluated -> True, BoxRatios -> {1, 1, 1}]

p[1,5,5] p[1,5,10] Not quite sure what you mean by "on the same graphic", so here's a few guesses.

cylinderlist =
Table[ParametricPlot3D[{(a + i*dx) Cos[t], (a + i*dx) Sin[t], h}, {t,
0, 2 Pi}, {h, 0, h[a + i*dx]}, PlotPoints -> 100], {i, n}]


Show them all in a row,

Grid[{cylinderlist}] Or perhaps laid over each other, on the same coordinate system

Show[Reverse@cylinderlist]


But there you can only see the outer one, but you can restrict the PlotRange to show them all

Show[Reverse@cylinderlist, PlotRange -> {Automatic, Automatic, {0, 30}}] Show@
Table[
ParametricPlot3D[
{(a + i*dx) Cos[t], (a + i*dx) Sin[t], h}, {t, 0, 2 Pi}, {h, 0, h[a + i*dx]},
BoxRatios -> {1, 1, 1},
PlotRange -> {{-30, 30}, {-30, 30}, {0, 600}},
PlotStyle -> Opacity[0.5], Mesh -> None
],
{i, 1, n}
] GraphicsRow[Table[ParametricPlot3D[{(a + i*dx) Cos[t], (a + i*dx) Sin[t], h},

{t, 0, 2 Pi}, {h, 0, h[a + i*dx]}], {i, 1, n}]]


or, use GraphicsGrid[] for more complex layouts (reference). Is it this, that you need?

 h[x_] := x^2; a = 1; b = 5; n = 5; dx = b - a/n;
Show@Table[
ParametricPlot3D[{(a + i*dx) Cos[t], (a + i*dx) Sin[t], h}, {t, 0,
2 Pi}, {h, 0, h[a + i*dx]}, PlotStyle -> Opacity[0.3],
PlotRange -> {{-30, 30}, {-30, 30}, {0, 650}},
ColorFunction -> "LakeColors"], {i, 1, n}]


May be, it will be better visible like this:

 Show@Table[
ParametricPlot3D[{(a + i*dx) Cos[t], (a + i*dx) Sin[t], h}, {t, 0,
2 Pi}, {h, 0, h[a + i*dx]}, PlotStyle -> Opacity[0.5],
PlotRange -> {{0, 30}, {-30, 0}, {0, 650}},
ColorFunction -> "LakeColors", ViewPoint -> {-30, 5, 60}], {i, 1,
n}]


you should see this: Have fun!