I’m trying to use PyGMT to plot some earthquakes and color them by their origin time
I have my earthquake catalogue in a Pandas dataframe and the origin time has been converted to a datetime object using:
catalogue['OriginTime'] = pd.to_datetime(catalogue['OriginTime'])
Then making a color pallete using:
pygmt.makecpt(cmap="hawaii", series=[pd.to_datetime("2015-03-03T00:00:00"),pd.to_datetime("2015-03-16T00:00:00"),1000])
Then try to plot using the color option as follows:
color=catalogue.loc['OriginTime']
However, this gives an error that I’m struggling to find a way around:
TypeError: sequence item 0: expected str instance, Timestamp found
I’ve tried converting the time output into a string using:
color=catalogue.loc['OriginTime'].dt.strftime('%Y-%m-%dT%H:%M:%S')
But that gives a similar error of:
TypeError: sequence item 1: expected str instance, float found
Any ideas?