0

I'm trying to make use of the function DensityPlot3D with the following specific example

DensityPlot3D[14.48 2.718^(2 Im[ArcTan[x,y]]) Abs[(Sqrt[x^2+y^2] SphericalBesselJ[1,7.72 Sqrt[x^2+y^2+z^2]])/Sqrt[x^2+y^2+z^2]]^2,{x,-1,1}, {y,-1,1},{z,-1,1},PlotLegends->Automatic,PlotRange->Automatic,PlotPoints->200]

from which I obtain (in the Mathematica notebook) a very opaque plot in gray as in this image:

enter image description here

Is this normal? If not, what am I missing? How could I obtain a plot like the one in the first answer of this question?

I also tried copying and pasting exactly the same code in that first answer, and I get a plot with the same problem: "completely gray".

However, if a save the plot as .pdf (right click -> Save Graphic As...) the plot reappears "magically" much better:

enter image description here

I'm using Mathematica 12.0 Student Edition.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
SNC92
  • 63
  • 6
  • The OpacityFunction is assigning too much opacity I think. Try making that have a stronger cutoff. Admittedly, though, I don't see your base issue generally. One worth trying might be like: OpacityFunction -> (Which[# > .25, #/2, # > .1, .1, True, 0] &) – b3m2a1 May 03 '19 at 06:24
  • @b3m2a1 Thanks, I'll try other things. Your last command it didn't work either; I've tried even with a simpler function, namely Sqrt[x^2 + y^2 + z^2] and the plot is still awful. – SNC92 May 03 '19 at 17:32
  • 1
    Please report this to support@wolfram.com, including the results of SystemInformation[] and details about your computer's OS version and hardware specs. – Brett Champion Jul 29 '19 at 04:34
  • The plot domain, a cube of dimensions 20, is not consistent with the code domain, a plot of dimensions 2. – bbgodfrey Aug 20 '19 at 04:17
  • this is an apparent bug in 12.0. I am using mmka on MacOSX and getting grey boxes even for the examples in mmka help for DensityPlot3D. – bronxy Jul 27 '19 at 22:37
  • @bronxy Which example? The ones I tried work fine in 12.0 on MacOS. – Rohit Namjoshi Jul 27 '19 at 23:25
  • @RohitNamjoshi Say even the very first one: DensityPlot3D[x y z, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] gets a grey cube. Latest version of MacOSX 10.14.6 on MacBook Pro 2018. If you know how to fix this, that would be greatly appreciated. – bronxy Jul 28 '19 at 15:54
  • @bronxy Hmm.. I see this – Rohit Namjoshi Jul 28 '19 at 18:00

1 Answers1

-1

I had a similar problem (and a bunch of others) on mmka 12.0. Reseting the Mathematica subsystem, i.e., deleting all the mmka created folders in ~/Library, has solved this problem. Apparently something went wrong when upgrading from the previous version.

bronxy
  • 1
  • 1