def METHOD_NAME(nside=2, cosdec=False, fn=None, textkws=None):
    def ycoord(y):
        if cosdec:
            return sin(deg2rad(y))
        else:
            return y
    clf()
    # RA,Dec grid lines.
    for x in range(-50,410,10):
        axvline(x=x, lw=0.5, ls='-', color='0.8')
    for y in range(-90,100,10):
        axhline(y=ycoord(y), lw=0.5, ls='-', color='0.8')
    if textkws is None:
        textkws = {}
    if not 'horizontalalignment' in textkws:
        textkws['horizontalalignment'] = 'center'
    if not 'verticalalignment' in textkws:
        textkws['verticalalignment'] = 'center'
    for hp in range(12 * nside**2):
        (racen,deccen) = healpix_to_radec(hp, nside, 0.5, 0.5)
        text(racen, ycoord(deccen), '%i' % hp, **textkws)
        nsteps = 20
        stepvals = [x/float(nsteps) for x in range(nsteps+1)]
        rstepvals = [1-x for x in stepvals]
        ones = [1.0]*(nsteps+1)
        zeros = [0.0]*(nsteps+1)
        x = stepvals + ones + rstepvals + zeros
        y = zeros + stepvals + ones + rstepvals
        edges = [healpix_to_radec(hp, nside, xx, yy) for (xx,yy) in zip(x,y)]
        ras = [ra for (ra,dec) in edges]
        decs = [dec for (ra,dec) in edges]
        if max(ras) > 270 and min(ras) < 90:
            # wrap-around!
            ras1 = []
            ras2 = []
            for ra in ras:
                if ra < 180:
                    ras1.append(ra)
                    ras2.append(ra+360)
                else:
                    ras1.append(ra-360)
                    ras2.append(ra)
            plot(ras1, ycoord(decs), 'k--')
            plot(ras2, ycoord(decs), 'k-')
            if racen > 180:
                text(racen-360, ycoord(deccen), '%i' % hp, **textkws)
            else:
                text(racen+360, ycoord(deccen), '%i' % hp, **textkws)
        else:
            plot(ras, ycoord(decs), 'k-')
    xlabel('RA (deg)')
    ylabel('Dec (deg)')
    ylim(ycoord(-90), ycoord(90))
    xlim(-40,400)
    yt = arange(-90, 100, 10)
    yticks(ycoord(yt), ['%g'%y for y in yt])
    title('Healpixes (nside=%i)' % nside)
    if fn is None:
        fn = 'healpix-%i.png' % nside
    savefig(fn)