How to plot datetime corresponds to latitude and longitude on a map while drawing cyclone track?

183 views Asked by At

I am using ibtracks cyclone data. I want to draw a cyclone track and DateTime corresponding to lat and long points on the map using python. I am able to draw track but not getting how to plot DateTime. Here is my code and my file.

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
import numpy as np
import tropycal.tracks as tracks
import datetime as dt

# load data
storm1 = cyclone.get_storm('IO012014')
lat = storm1['lat'][:]
lon = storm1['lon'][:]
date = storm1['date'][:]

# figure
fig = plt.figure(figsize=(12,9))
m = Basemap (projection='merc', llcrnrlon=50, llcrnrlat=5, urcrnrlon = 98, urcrnrlat=25, resolution='i')
m.etopo()
m.drawparallels(np.arange(-90., 90., 10.), labels=[1,0,0,0], fontsize=10, linewidth=0.5, color='k')
m.drawmeridians(np.arange(-180., 180., 10.), labels=[0,0,0,1], fontsize=10, linewidth=0.5, color='k')
x, y = m(lon, lat)
m.plot(x, y, 'o-', color='r')

my file structure

my file looks like

0

There are 0 answers