Coloring error bars

I would like to colour error bar using the command below (GMT6) based on the error_bar_values.

gmt makecpt -T0./.6/0.1 -Chaxby -Z   > temp.cpt
 gmt   plot  file_(lat,long,**error_bar**) -Ctemp.cpt  -Ey0.2/.75p,solid  -Bya1g.2+l"[mm/yr]"  -BSWne -Bxa1g1
gmt colorbar  -Ctemp.cpt  -Dx1c/1c+w2c/0.2c+jLB+h  -Bx.1f.1+l"error" -By+lmm/yr  --FONT_ANNOT_PRIMARY=5p

This seems not working? the error message being:
plot [WARNING]: Mismatch between actual (3) and expected (4) fields near line 1 in file

I think your input data should be x,y,z,error
you could do z=error
and you could try something like:
echo "-45 -23 0.2 1" | gmt psxy -R-50/-40/-25/-21 -JX10c -Ctemp.cpt -Ey+w0.2+p0.75p,solid+cf -Bya1+l"[mm/yr]" -BSWne -Bxa1 >
which results in:

1 Like

You can use the trick of duplicating your third column with -i0-2,2 in the plot command.

1 Like

Thank you very much, Marcelo. The +cf did the trick following your recommendations.

Hi Joaquim,
I have started to change all my GMT 5 version to GMT6. I must say it saves so much time specifically fiddling to insert a text for the intended places. Simply awesome. GMT6 rocks !!!

Yes, I did try to feed the plot command 4 parameters repeating the third one before I sent my question to the community but it still failed, then when I insert +cf as recommended by @MarceloBanik, it is now working.