Hi @weiji14,
Thank you for your quick response.The problem with passing x and y coordinates in as in your example is that there are multiple different lines contained in one file. I could not find a way to plot the two separate lines in one command using the pandas method, though I am relatively new to python/pandas.
Solution
The suggestions of using fig.plot data argument worked well on the file format shown in my first post, thanks!
I used:
fig.plot(data = ‘file_of_lines.txt’)
where ‘file_of_lines.txt’ is in the format:
-L"Line1"
15.2467712458 40.5677764864
15.2653163928 40.5613102162
15.2892336577 40.5523798281
15.2943839775 40.5506614258
-L"Line2"
15.114091938 40.8637241151
15.1141461644 40.8637064216
15.1150913548 40.8633980347.
I generated ‘file_of_lines.txt’ using kml2gmt from a kml file which contained 2 different sets of points delineating two lines. I generated this in normal gmt (non-pygmt). Is it possible to run kml2gmt within pygmt?
As an aside I tried to use the same command on a kml file:
fig.plot(data = ‘file_of_lines.kml’)
This produced the error
plot[ERROR]: Mismatch between actual (1) and expected (2) fields near line 3 in file
plot [ERROR]: Mismatch between actual (1) and expected (2) fields near line 4 in file file_of_lines.kml
which may be of interest to you