#fig.gca().add_artist(rect)
    plt.axvline(20.0, color='white')
    plt.axvline(35.0, color='white')
    plt.axhline(5.6, color='white')
    plt.axhline(7.0, color='white')
    #plt.savefig(path.join(outdir, 'tempsolutions_em={}'.format(np.log10(wid)).replace('.', '_')))
    plt.savefig(path.join(outdir, 'tempsolutions_wid={:.3f}'.format(wid).replace('.', '_')))
    plt.close()

    if n_pars == 3:
        emdata = Map(newmap.emission_measure, newmap.meta.copy())
    else:
        if emwlen == 'three':
            total = np.zeros(newmap.shape)
            for w in ['171', '193', '211']:
                emdata = newmap.calculate_em(w, model=True)
                total += emdata.data
            emdata.data = total/3.0
        elif emwlen == 'all':
            total = np.zeros(newmap.shape)
            for w in ['94', '131', '171', '193', '211', '335']:
                emdata = newmap.calculate_em(w, model=True)
                total += emdata.data
            emdata.data = total/6.0
        else:
            emdata = newmap.calculate_em(emwlen, model=True)
    trueem = np.array(list(heights)*n_temps).reshape(n_temps, n_heights)
    diffem = Map((abs(trueem - emdata.data) / trueem) * 100, newmap.meta.copy())
    #print wid, emdata.xrange, emdata.yrange, emdata.scale
    #print wid, diffem.xrange, diffem.yrange, diffem.scale
    #print wid, fitsmap.xrange, fitsmap.yrange, fitsmap.scale