-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pygmt.Figure.text()
: incols
(-i
) parameter does not work as described in the documentation
#1947
Comments
@PaulWessel Could you please explain why |
pstext was written a long time ago when GMT4 syntax for input prevailed. Input was expected to be
We later improved this via the -F settings. The overall result is that because of backwards compatibility this module is not reading data as numerical plus trailing text but as two leading numerical columns (3 if -Z) and the rest is read as trailing text which we further parse internally in text based on -F. Thus -i does not really work for this module. |
@PaulWessel Thanks for the good explanations. @yvonnefroehlich I think we just need to update the |
Also, from my side thanks to @PaulWessel for the background explanations!
@seisman Yes, looks like this. So, should I open a pull request to reduce the |
Yes, should remove the Line 159 in 1067fa3
|
Description of the problem
The
incols
(-i
) parameter of the methodpygmt.Figure.text()
does not provide the functionality as described in the documentation.In this minimal example the data is provided via a txt-file (test_text.txt) with three columns (x,y,text) and two lines and passed through the
textfiles
parameter. I tested both passing a string and a 1-D array through theincols
parameter. When trying to resort the columns 'x' and 'y' viaincols=[1,0,2]
orincols='1,0,2'
the below given error arises (cases (iv), (v)). This problem occurs already when using theincols
parameter without any resorting of the columns, i. e.incols=[0,1,2]
orincols='0,1,2'
(cases (ii), (iii)). This holds also for skipping columns (no code example provided).Relation to GMT
In the GMT documentation (version 6.3) I can not find
-i
flags
for text (in contrast to plot), only-it
word
and-:
[i|o]
are listed. However, the PyGMT documentation (version 0.6.1) describes the same functionality of theincols
parameter for pygmt.Figure.text() and pygmt.Figure.plot(). Maybe it is not a bug, but an error in the PyGMT documentation (?), since the error message below says:Full code that generated the error
Full error message
For the cases (ii) to (v):
System information
Output of
python -c "import pygmt; pygmt.show_versions()"
:The text was updated successfully, but these errors were encountered: