5
$\begingroup$

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"]

enter image description here The final goal is to obtain a similar picture as was included

$\endgroup$
5

2 Answers 2

8
$\begingroup$
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}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Okkes, thank you for your help! $\endgroup$
    – irondonio
    Dec 24, 2018 at 1:23
7
$\begingroup$

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[1] is a twodimensional list of points. The third dimension of arg[1], for example z==-1, has to be added.

arg = Apply[List, pic[[1]]];

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

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

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]

enter image description here

$\endgroup$
1
  • $\begingroup$ Ulrich, thank you very much! $\endgroup$
    – irondonio
    Dec 24, 2018 at 1:22

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