Discussion:
plotting shaded area
David Schubert
2012-11-19 14:59:49 UTC
Permalink
Dear GMT Users,

i have plotted a simple line with psxy (see attachment). Now i wonder
if it is possible to plot the line with its confidence intervals where
the area between the lines are shaded. I have also attached an example
picture. Is there any way to do this?

My data are build like this:

x value; y value; error of y

Regards,

David

To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Paul Wessel
2012-11-19 15:06:15 UTC
Permalink
Use a tool to build a temporary polygon for shading, e.g.

awk '{print $1, $2+$3}' yourfile > polygon
tail -r yourfile | awk '{print $1, $2-$3}' yourfile >> polygon

Then plot it with psxy before you plot your curve.

psxy -R -J .. -Glightgray polygon >> plot.ps
...

Paul Wessel, Professor
Dept. of Geology & Geophysics
SOEST, University of Hawaii at Manoa
1680 East-West Rd, Honolulu, HI 96822 USA
Post by David Schubert
Dear GMT Users,
i have plotted a simple line with psxy (see attachment). Now i wonder if it is possible to plot the line with its confidence intervals where the area between the lines are shaded. I have also attached an example picture. Is there any way to do this?
x value; y value; error of y
Regards,
David
<shaded_area.png><gleitender_Durchschnitt_Antiyklonal_Suedwest_Nord.ps>
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Peter Schmidt
2012-11-19 15:07:41 UTC
Permalink
Sure

Not directly perhaps but with a little bit of scripting, something along
the lines (linux/unix)

cat data | awk '{print $1, $2+$3}' > tmp.dat
tac data | awk '{print $1, $2+$3}' > tmp.dat

should give you a polygon that can be plotted with psxy using -Ggray for
filling

regP
Post by David Schubert
Dear GMT Users,
i have plotted a simple line with psxy (see attachment). Now i wonder
if it is possible to plot the line with its confidence intervals where
the area between the lines are shaded. I have also attached an example
picture. Is there any way to do this?
x value; y value; error of y
Regards,
David
To unsubscribe, send the message "signoff gmt-help" to
--
********************************************************************************
Peter Schmidt Tel: +46-18-4717104
Swedish National Seismological Network (SNSN) Mobile: +46-73-3190975
Dept. of Earth Sciences:geophysics e-mail: ***@geo.uu.se
Uppsala University
Villavagen 16
SE-75236 Uppsala
********************************************************************************

To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
David Schubert
2012-11-19 15:10:52 UTC
Permalink
Thanks a lot to both. It works perfectly.

Regards,
David
Post by Peter Schmidt
Sure
Not directly perhaps but with a little bit of scripting, something
along the lines (linux/unix)
cat data | awk '{print $1, $2+$3}' > tmp.dat
tac data | awk '{print $1, $2+$3}' > tmp.dat
should give you a polygon that can be plotted with psxy using -Ggray
for filling
regP
Post by David Schubert
Dear GMT Users,
i have plotted a simple line with psxy (see attachment). Now i
wonder if it is possible to plot the line with its confidence
intervals where the area between the lines are shaded. I have also
attached an example picture. Is there any way to do this?
x value; y value; error of y
Regards,
David
To unsubscribe, send the message "signoff gmt-help" to
--
********************************************************************************
Peter Schmidt Tel: +46-18-4717104
Swedish National Seismological Network (SNSN) Mobile: +46-73-3190975
Uppsala University
Villavagen 16
SE-75236 Uppsala
********************************************************************************
To unsubscribe, send the message "signoff gmt-help" to
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Continue reading on narkive:
Loading...