0

I'm new to healpy and I'm trying to plot the following in iPython27:

import numpy as np
import healpy as hp

NSIDE = 32
m=np.arange(hp.nside2npix(NSIDE))
hp.mollview(m, title="Mollview image RING")

This does not return an image as I was expecting. What could be the problem?

berkelem
  • 2,005
  • 3
  • 18
  • 36

1 Answers1

0

You need to setup IPython to display matplotlib plots.

If you are using IPython console

%matplotlib

If IPython notebook

%matplotlib inline
Andrea Zonca
  • 8,378
  • 9
  • 42
  • 70
  • Thank you - I didn't know about the iPython notebook. I usually use gedit when coding - is there any way of making this work with a .py file? Or is that counter productive? – berkelem Apr 29 '15 at 04:57
  • Usual way is to open IPython, configure matplotlib and then `%run` your .py script. – Andrea Zonca Apr 29 '15 at 14:06