- #1
dewood88
- 1
- 0
I am new to Mathematica and I am trying to make models of white dwarf spherical harmonics similar to the ones on this site: http://whitedwarf.org/education/vis/index.html. So far the closest thing I have is this:
SphericalPlot3D[3, {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]},
Mesh -> None,
ColorFunction ->
Function[{x, y, z, \[Theta], \[Phi], r},
Evaluate[
Hue@Rescale[
Arg@Re[SphericalHarmonicY[3,
1, \[Theta], \[Phi]]], {-\[Pi], \[Pi]}]]],
ColorFunctionScaling -> False, PlotPoints -> 35]
However, the color scaling does not allow a blending of the two colors, so instead I would like to wrap a density plot like this one:
Manipulate[
DensityPlot[
Re[SphericalHarmonicY[l, m, \[Theta], \[Phi]]], {\[Theta],
0, \[Pi]}, {\[Phi], 0, 2 \[Pi]},
FrameLabel -> {\[Theta], \[Phi]}], {l, 1, 10, 1}, {m, 0, 10, 1}]
over a sphere of radius 3 and be able to control the l and m values with sliders ("Manipulate"). Does anyone know a simple way to do this? Any helpful hints would be greatly appreciated! :)
SphericalPlot3D[3, {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]},
Mesh -> None,
ColorFunction ->
Function[{x, y, z, \[Theta], \[Phi], r},
Evaluate[
Hue@Rescale[
Arg@Re[SphericalHarmonicY[3,
1, \[Theta], \[Phi]]], {-\[Pi], \[Pi]}]]],
ColorFunctionScaling -> False, PlotPoints -> 35]
However, the color scaling does not allow a blending of the two colors, so instead I would like to wrap a density plot like this one:
Manipulate[
DensityPlot[
Re[SphericalHarmonicY[l, m, \[Theta], \[Phi]]], {\[Theta],
0, \[Pi]}, {\[Phi], 0, 2 \[Pi]},
FrameLabel -> {\[Theta], \[Phi]}], {l, 1, 10, 1}, {m, 0, 10, 1}]
over a sphere of radius 3 and be able to control the l and m values with sliders ("Manipulate"). Does anyone know a simple way to do this? Any helpful hints would be greatly appreciated! :)