Plot [WARNING]: Mismatch between actual and expected fields near line 1

The following lines are an extract of the file (TEST.txt) that I want to plot:
(X,Y,A,B)
-8.68,37.11,12.00,22095.00
-8.23,37.10,10.40,26742.00
-7.93,37.02,9.60,44578.00
-8.43,37.19,11.30,11014.00

I aim to plot “A” by using colors (from a cpt file) and “B” by varying the size at coordinates XY. Code is as follows:

gmt makecpt -Cjet -T4.0/12.0/0.5 -H > symbol_colors.cpt
gmt info TEST.txt 
gmt plot -W0.3 -Sci -C -i1,2,3,4+s0.025 TEST.txt

the output is:

TEST.txt: N = 4	<-8.68/-7.93>	<37.02/37.19>	<9.6/12>	<11014/44578>
plot [WARNING]: Mismatch between actual (3) and expected (4) fields near line 1 in file TEST.txt

I have be trying to fix the issue but I have been unable to resolve it. I have read several threads in the forum, but none of them worked. I also tried using different field separators but none of them worked. Does anyone have any suggestions?

GMT starts counting at zero. You probably want -i0,1,2,3+s0.025

1 Like

Thanks for correct the small big issue because when I when I use -i0,1,2,3+s0.025

raises the following error:

TESTE.txt: N = 8796	<-17.18/-1.6>	<28.83/43.73>	<4.4/12>	<3/3305408>
Error: /limitcheck in --arc--
Operand stack:   6710   7504   4958112   0   360
Execution stack:   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1944   1   3   %oparray_pop   1943   1   3   %oparray_pop   1928   1   3   %oparray_pop   1801   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--
Dictionary stack:   --dict:751/1123(ro)(G)--   --dict:0/20(G)--   --dict:85/200(L)--   --dict:160/250(L)--
Current allocation mode is local
Current file position is 5004845
psconvert [ERROR]: System call [gs -q -dNOSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -DPSL_no_pagefill -dMaxBitmap=2147483647 -dUseFastColor=true '/Users/joaofontiela/.gmt/sessions/gmt_session.65789/gmt_0.ps-' 2> '/Users/joaofontiela/.gmt/sessions/gmt_session.65789/psconvert_65835c.bb'] returned error 256.
end [ERROR]: Failed to call psconvert
end [ERROR]: gmtinit_process_figures returned error 79

I realize the source of the error. In the full file, the maximum B value is 3305408 times +s size, making GMT crash.

Anyone has a solution to varying symbol size by classes? Like B < 100000; 100000 < B < 1000000; and B > 1000000

You can make a categorical CPT (see 3. General Features — GMT 6.5.0 documentation)