# Combine different kinds of plots [duplicate]

how can i combine thats plots:

p1 = ContourPlot3D[
x^2 + y^2 + 100*(z - 11)^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, 11,
11.3}]
p2 = Manipulate[
VectorPlot3D[{0, 0, -b^3 (x^2 + y^2) Cos[b^2 (x^2 + y^2)]}, {x, -1,
1}, {y, -1, 1}, {z, 11, 11.3}], {b, 0.01, 3}]
Show[p1,p2]


i tried the "Show" function.

• This seems to be a duplicate of your other question: How to combine Graphics – C. E. Jun 21 '20 at 18:36
• no its not beacuse Show doesnt work here – amit Jun 21 '20 at 19:00
• Show does work here. If you provide an example of how you used Show, then we can tell you what’s wrong. (A likely mistake is that you are putting Manipulate, which is not a type of graphics, inside Show, rather than Show inside Manipulate.) – C. E. Jun 21 '20 at 19:09
• i update my code. if i cant use Manipulate inside Show how can i still controll the parmeter b – amit Jun 21 '20 at 19:23
• As @C.E. said, the Show needs to be inside the Manipulate. Manipulate[Show[VectorPlot3D[...], p1], {b, 0.01, 3}]. – Rohit Namjoshi Jun 21 '20 at 23:52

Clear["Global*"]

cp3d = ContourPlot3D[
x^2 + y^2 + 100*(z - 11)^2 == 1,
{x, -1, 1}, {y, -1, 1}, {z, 11, 11.3}];

Manipulate[
Show[
cp3d,
VectorPlot3D[
{0, 0, -b^3 (x^2 + y^2) Cos[b^2 (x^2 + y^2)]},
{x, -1, 1}, {y, -1, 1}, {z, 11, 11.3},
PlotLegends -> Automatic,
VectorPoints -> vp]],
{{vp, 4, VectorPoints}, Range[2, 6]},
{{b, 1}, 0.01, 3, Appearance -> "Labeled"}]


EDIT: Using a point pattern of "Mesh" gives much smaller arrows.

cp3d = ContourPlot3D[
x^2 + y^2 + 100*(z - 11)^2 == 1,
{x, -1, 1}, {y, -1, 1}, {z, 11, 11.3},
ContourStyle -> Directive[Orange,
Opacity[0.8], Specularity[White, 30]]];

Manipulate[
Show[
cp3d,
VectorPlot3D[
{0, 0, -b^3 (x^2 + y^2) Cos[b^2 (x^2 + y^2)]},
{x, -1, 1}, {y, -1, 1}, {z, 11, 11.3},
VectorPoints -> {ppat, vp},
VectorAspectRatio -> var]],
{{ppat, "Mesh", "Point Pattern"},
{"Hexagonal", "FaceCenteredCubic", "Mesh", "Regular"}},
{{vp, 2, VectorPoints}, Range[2, 6],
ControlType -> SetterBar},
{{var, 1.5, VectorAspectRatio}, 0.1, 2, 0.05,
Appearance -> "Labeled"},
{{b, 1}, 0.01, 3, Appearance -> "Labeled"}]


• Do you know how to scale the vectors down in the z direction? I can't figure it out for the life of me. I've tried VectorScaling / VectorSizes to no avail. – flinty Jun 21 '20 at 20:00
• @flinty its an argument within Arrow. I think that link should clarify it. – CA Trevillian Jun 22 '20 at 1:15
• the code which was editted Fails to work. – amit Jun 22 '20 at 6:47
• i mean VectorAspectRatio is not working with VectorPlot3D – amit Jun 22 '20 at 12:08
• @amit - the documentation indicates that VectorAspectRatio` is new in v12.1. Presumably, you have an earlier version. Just delete that option and the corresponding control. – Bob Hanlon Jun 22 '20 at 13:06