FMS plotting issue in pygmt?

Hi everyone,
I am trying to plot FMS as per the instruction provided on pygmt web page. However, i did not get any result. Error message saying that my file is not in correct format. May someone suggest me how i can prepare a file including the label text for each FMS beach ball.

 data=pd.read_csv("FMS.txt", sep='\s+')
 fig.meca(spec=data, convention='aki', offset=True, scale='0.3c', C=True)

FMS.txt (280 Bytes)

Hello @Adnan,

You have to use longitude and latitude for the columns names, instead of lon and lat.

Futhermore it looks like you mixed up longitude and latitude for either the event location (colums longitude and latitude) or the plot location (colums plot_latitude and plot_longitude) in your FMS.txt file:

longitude	latitude	depth	strike	dip	rake	magnitude	plot_latitude	plot_longitude 
73.47	34.38	12.0	334	40	123	7.6	73.67	34.42	
71.27	32.95	15.0	237	5	79	6	71.40	33.05
73.85	32.83	14.7	246	10	52	5.9	73.95	33.00
73.21	33.92	22.1	148	82	6	5	73.31	34.00	
73.51	32.62	24.7	246	21	61	4.9	73.39	32.50 

To add labels to the single beachballs you need a column event_name containing the desired text:

longitude	latitude	depth	strike	dip	rake	magnitude	plot_latitude	plot_longitude event_name
73.47	34.38	12.0	334	40	123	7.6	73.67	34.42	event_1
71.27	32.95	15.0	237	5	79	6	71.40	33.05	event_2
73.85	32.83	14.7	246	10	52	5.9	73.95	33.00	event_3
73.21	33.92	22.1	148	82	6	5	73.31	34.00	event_4
73.51	32.62	24.7	246	21	61	4.9	73.39	32.50 	event_5
1 Like

Thanks for suggestions,

It works well but only without the event label.
For example, if i use the following format, it plots the FMS

longitude	latitude	depth	strike	dip	rake	magnitude	plot_longitude	plot_latitude
73.47	34.38	12	334	40	123	6.4	73.85	34.75

But when I add the event label, then error.

longitude	latitude	depth	strike	dip	rake	magnitude	plot_longitude	plot_latitude	event_name
73.47	34.38	12	334	40	123	6.3	73.85	34.75	m6-2010

Plus, I also like to include direction from epicenter toward the source.