Esempio n. 1
0
slider_min = 0.0
slider_max  = 1.0

lats_lons = getLatsAndLongsByTimePercentage(t0)
lats = lats_lons[0]
lons = lats_lons[1]
x,y = map(lons, lats)
map.plot(x, y, 'ro',fillstyle='none', markersize=8)

#---Slider Code--- 
subplots_adjust(left=0.25, bottom=0.25)                                         
slider_color = 'lightgoldenrodyellow'                                                
slider_dimens  = axes([0.25, 0.15, 0.65, 0.03], axisbg=slider_color)                         

slider_time = Slider(slider_dimens, 'Time', slider_min, slider_max, valinit=t0)
slider_time.label='slider label'

def update(val):
    subplot(111)
    plt.cla()
    time_percentage = val
    lats_lons = getLatsAndLongsByTimePercentage(time_percentage)
    lats = lats_lons[0]
    lons = lats_lons[1]
    start_date = lats_lons[2]
    stop_date  = lats_lons[3]
    axis1.text(0.95, 0.01, start_date+'  '+stop_date,
        verticalalignment='bottom', horizontalalignment='right',
        transform=axis1.transAxes, color='cyan', fontsize=15)
    x,y = map(lons, lats)
    map.plot(x, y, 'ro',fillstyle='none', markersize=8)