1
$\begingroup$

I have a table of dimensions {$\theta$,$z$}= {20,200} that I want to plot as a cylinder instead of a plane.

The code I have is:

thetaPts = 20;
thetaVals = Table[2 Pi  i/thetanPts, {i, 0, thetaPts - 1}];
zPts = 200;
zVals = Table[z, {z, 0, zPts - 1}];
cylinderVals = Table[1, {theta, thetaVals}, {z, zVals}];
ListPlot3D[cylinderVals, AxesLabel -> {"z", "\[Theta]"}]

Which gives this 3D plot:

Plane that I want to be wrapped around a cylinder

Is there any way to plot the output from ListPlot3D as a 3d cylinder (with $\theta$ being the azimuthal direction and $z$ being the axial direction) instead of a plane?

I have other surfaces I want to wrap around cylinders so I want to find out how to do this with ListPlot3D.

$\endgroup$

1 Answer 1

2
$\begingroup$

A cylinder with a height of e.g. 10 :

d = Flatten[
   Table[{Cos[p], Sin[p], z}, {p, 0, 2 Pi, Pi/10}, {z, 0, 10}], 1];
ListSurfacePlot3D[d]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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