Say I have a function $y=x^2 + 2x + 1$ and I want to plot it over the cross sectional area of a hollow cylinder between $x=1$ and $x=2$ in Mathematica. See the attached example below. How do you go about making figures of this type in Mathematica? 
Asked
Active
Viewed 76 times
1
Engineer
- 119
- 3
2 Answers
2
- Maybe you want a
DensityPlotin polar coordinates with functionf[r_, θ_] := r^2 + 2 r + 1;. - See also https://mathematica.stackexchange.com/a/300171/72111
Clear["Global`*"];
f[r_, θ_] := r^2 + 2 r + 1;
DensityPlot[
f[r, θ] // Evaluate, {r, 1, 2}, {θ, 0, π/2},
PlotRange -> All,
DisplayFunction ->
ReplaceAll[{r_Real, t_Real} :> {r*Cos[t], r*Sin[t]}],
ColorFunction -> Hue]
cvgmt
- 72,231
- 4
- 75
- 133
1
Your equation makes no sense. But the closest thing that does make sense is:
RevolutionPlot3D[r^2 + 2 r + 1,
{r, 1, 2},
{\[Theta], 0, \[Pi]/2}.
ColorFunction->"Rainbow"]
David G. Stork
- 41,180
- 3
- 34
- 96


x,yandθ? – cvgmt Mar 12 '24 at 00:08