Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

sums_12p.sh 655 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
  1. #!/usr/bin/env bash
  2. # Test grdmath CUMSUM operators row and col sums in positive direction
  3. ps=sums_12p.ps
  4. gmt set MAP_TITLE_OFFSET 4p FONT_TITLE 12p
  5. # Create a small grid and compute row and column sums
  6. gmt grdmath -R0/5/0/3 -I1 X Y MUL = t.grd
  7. gmt grdmath t.grd 1 CUMSUM = r.grd
  8. gmt grdmath t.grd 2 CUMSUM = c.grd
  9. # Plot the three grids
  10. gmt grd2xyz t.grd | gmt pstext -R0/5/0/3 -JX6.5i/2.5i -P -B0g1 -B+tDATA -K -N -Y7.5i -F+f18p+jCM -Gwhite > $ps
  11. gmt grd2xyz r.grd | gmt pstext -R -J -O -K -B0g1 -B+t"+1 CUMSUM" -Y-3.25i -N -F+f18p+jCM -Gwhite >> $ps
  12. gmt grd2xyz c.grd | gmt pstext -R -J -O -B0g1 -B+t"+2 CUMSUM" -Y-3.25i -N -F+f18p+jCM -Gwhite >> $ps
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...