I am trying to use the SphericalDensityPlot3D function that is defined here: Spherical Density Plot 3D. However, when I run all the contents of the mathematica package (".m") file, I get the following errors:

Get::noopen: Cannot open Utilities`FilterOptions.

Needs::nocont: Context Utilities`FilterOptions was not created when Needs was evaluated.

This happens when the following cell is evaluated:


The last revision for this package is from 2001 and so I assume there are is some compatibility issue, since I am running version 11.2. So, does anyone know how I could fix this problem?



1 Answer 1


The FilterOptions issue has been discussed in a number of posts, you can simply modify the line



If[$VersionNumber >= 9,
   FilterOptions[a_,b___] := Sequence @@ FilterRules[{b}, Options[a]],

This isn't the end. Though I can't figure out what exactly they are, the package has made use of some outdated features of Graphics3D, so to get the desired result, you need to execute

<< Version5`Graphics`


enter image description here

But, since you're in v11.2, why not turn to SliceDensityPlot3D? You just need to transform the coordinate first:

expr = TransformedField[ "Spherical" -> "Cartesian", 
   Re[SphericalHarmonicY[4, 2, th, ph]], {r, th, ph} -> {x, y, z}];

SliceDensityPlot3D[expr, "CenterSphere", {x, y, z} ∈ Ball[], 
 PlotLegends -> Automatic]

Mathematica graphics

BTW, for those before v10.2, I think the solutions in this post are better alternatives compared to this package.

  • $\begingroup$ +1, nice. I did not know about this method. I removed my hack answer. $\endgroup$
    – Nasser
    Commented May 8, 2018 at 6:07
  • $\begingroup$ This is a great answer! Thanks! $\endgroup$
    – AG1123
    Commented May 8, 2018 at 7:45
  • 1
    $\begingroup$ @AG1123 Thanks for accepting, but actually you don't need to accept that fast, you can wait for 24 hours or even longer to see if someone will come up with a better answer :) . $\endgroup$
    – xzczd
    Commented May 8, 2018 at 7:53
  • $\begingroup$ I will keep that in mind in the future. :-) $\endgroup$
    – AG1123
    Commented May 8, 2018 at 7:59
  • $\begingroup$ This fix for FilterOptions does not seem to work in version 12. Does anyone have a new fix? $\endgroup$ Commented Feb 21, 2020 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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