0

I've googled around for this and am unable to find anything which suggests that it may not exist, but I wanted to ask stackoverflow.

I'm using python, together with matplotlib and I'm looking to plot something like this: http://en.wikipedia.org/wiki/File:Spherical_harmonics.png

Essentially what I would call a 3d heatmap, a 3d surface with colours representing the magnitude of a function at that point. Similar to the link above I want to plot a colourised sphere, showing the value of the magnitude of this function at this point.

Is this possible

V.S.
  • 2,924
  • 4
  • 32
  • 43

1 Answers1

2

You can use the mplot3d toolkit, http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/index.html

Chris Kuklewicz
  • 8,123
  • 22
  • 33
  • 1
    and specifically look at http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#surface-plots -- you'll need to figure out how to map the appropriate colors onto the surface probably using the `facecolors` parameter – JoshAdel Mar 18 '11 at 18:00
  • For an example on how to use `facecolors`, I can refer you to one of my previous posts: http://stackoverflow.com/questions/5276303/how-to-annotate-highlight-a-3d-plot-in-matplotlib/5276486#5276486 – Paul Mar 18 '11 at 22:19
  • Whilst I'd found the correct 3d plotting thing I had not realised what "facecolors" did. I also didn't realise that the bottom example here incorporates it, but it does as it's half blue and yellow. – V.S. Mar 19 '11 at 00:27