Fill region between error bars

Hi!
I am trying to give color (gray) to the region inside error bars. The idea is to obtain something similar to the attached image. However, I do not see enough examples of the coding with GMT.

psbasemap -JX6i -R150/300/-7/5 -Bxf10a100 -Byf0.5a1 -By+l"(mm/yr)" -Bx+l"Distance along profile (km)" -BWeSn -K -Xc -Yc > a.ps
awk ‘{print $4,$2,$3}’ file.txt | psxy -J -R -Ey -W1.0 -O -K >> a.ps
awk ‘{print $4,$2-0.25,$1}’ file.txt | pstext -J -R -F+f9p,Times-Bold,black -O -K >> a.ps
awk ‘{print $4,$2,$1}’ file.txt | psxy -J -R -Sc0.25 -W0.5 -Gblack -O >> a.ps
psconvert a.ps -A -Tt

file.txt (242 Bytes)

I will appreciate the help.

I have no idea if this would work, but maybe you could use psxy with -Sb to plot vertical bars at each datapoint? Using the lower line as base, extending to y (upper line). Might need some preprocessing of your data. See https://docs.generic-mapping-tools.org/latest/psxy.html#optional-arguments.

GMT devs: Is it possible to link directly to the -Sb-switch in the GMT-docs? I’m able to easily copy links to sections higher in the hierarchy (as I did above).

1 Like

Have you checked this example??

1 Like

See plot -L modifiers.

1 Like

Thanks!
The examples were very useful
The -L option works perfectly :slight_smile: