PRO thm_plot_gmag_station_mag

    ; get a list of the stations for this plot
    thm_gmag_stations, labels, locations

    ; set up plot parameters
    loadct, 1
    set_plot, 'z'
    device, set_resolution=[750,750]
    chars=1.0
    
    ; draw the borders
    map_set, 58.5, -108.0, /stereo, /conti, scale=2.8e7, $
             color=250, title='THEMIS GMAG'
    borders=tvrd()
    erase
 
    ; draw country and state boundaries
    map_set, 58.5, -108.0, /stereo, /conti, scale=2.8e7, $
             /usa, e_continents={COUNTRIES:1}, color=100
    usaborders=tvrd()
    erase

    ; fill
    map_set, 58.5, -108,0, /stereo, /conti, scale=2.8e7, $
             color=255, e_continents={FILL:1}
    color_map=tvrd()
    erase
    color_map[where(usaborders eq 100)]=200
    color_map[where(color_map eq 0)]=238
    color_map[where(borders eq 250)]=1

    tv, color_map

    ; add lat long grid lines
    map_grid, color=0

    ; display image
    image=tvrd()
    device, /close
    set_plot, 'win'
    window, 5, xsize=750, ysize=500
    tv, image

    write_gif, 'test.gif', image

 
END