# Bessel Beam , how it is possible to plot a 3D with a 2D projection in one plot? [duplicate]

This question already has an answer here:

Sincerely, I am new in Mathematica, I checked all the previous post.

The idea is to plot a 3D Bessel function with a 2D projection

They can be generated as follows.

Plot3D[BesselJ[0, Sqrt[x^2 + y^2]], {x, -10, 10}, {y, -10, 10},
ColorFunction -> "Rainbow"]

DensityPlot[BesselJ[0, Sqrt[x^2 + y^2]], {x, -10, 10}, {y, -10, 10},
PlotPoints -> 100, ColorFunction -> "Rainbow",
PerformanceGoal -> "Quality"] The final goal is to obtain a similar picture as was included

## marked as duplicate by J. M. is away♦ plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 4 at 6:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• So what's your question? – David G. Stork Dec 23 '18 at 16:11
• How to join both plots 3D and 2D in an single one – irondonio Dec 23 '18 at 16:23
• Possibly duplicate of this question and this one – m_goldberg Dec 23 '18 at 16:48
• This question might help you too. – Chip Hurst Dec 23 '18 at 17:20
• – Alex Trounev Dec 24 '18 at 0:52

## 2 Answers

p1 = Plot3D[BesselJ[0, Sqrt[x^2 + y^2]], {x, -10, 10}, {y, -10, 10},
PlotPoints -> 200, ColorFunction -> "Rainbow", Mesh -> None,
Boxed -> False, BoxRatios -> {1, 1, 1}];

p2 = DensityPlot[
BesselJ[0, Sqrt[x^2 + y^2]], {x, -10, 10}, {y, -10, 10},
PlotPoints -> 300, ColorFunction -> "Rainbow",
PerformanceGoal -> "Quality", Frame -> False,
PlotRangePadding -> None];

p3 = Plot3D[-1, {x, -10, 10}, {y, -10, 10}, PlotStyle -> Texture[p2],
Mesh -> None];

Show[p1, p3, PlotRange -> {-1, 1}] • Okkes, thank you for your help! – irondonio Dec 24 '18 at 1:23

Let's call the second plot

pic = DensityPlot[BesselJ[0, Sqrt[x^2 + y^2]], {x, -10, 10}, {y, -10, 10},PlotPoints -> 100, ColorFunction -> "Rainbow",PerformanceGoal -> "Quality"]


pic is a Graphicsobject Graphics[GraphicsComplex[arg]], arg is a twodimensional list of points. The third dimension of arg, for example z==-1, has to be added.

arg = Apply[List, pic[]];


We now have to change the pointlist 2D->3D

pic3D=Graphics3D[Apply[GraphicsComplex, {Map[{#[], #[], -1} &, arg[]],arg[], arg[]}]]


This 3D-picture can be displayed together with the first

Show[{Plot3D[BesselJ[0, Sqrt[x^2 + y^2]], {x, -10, 10}, {y, -10, 10}, ColorFunction -> "Rainbow"], pic3D}, PlotRange -> All] • Ulrich, thank you very much! – irondonio Dec 24 '18 at 1:22