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

weightedrect.sh 2.1 KB

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
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  1. #!/usr/bin/env bash
  2. # Test most operators in gmtbinstats for rectangular binning, using weights
  3. gmt begin weightedrect ps
  4. gmt set FONT_TAG 12p MAP_FRAME_TYPE plain
  5. gmt convert @capitals.gmt -a2=population,3=population > tmp.txt
  6. gmt subplot begin 7x2 -Fs3i/1.25i -M15p/5p -A+gwhite -SCb -SRl -Bwstr -R-110/250/-75/75 -JQ70E/3i -X1.25i -Y0.5i
  7. # Plot data
  8. gmt subplot set 0 -Adata
  9. gmt makecpt -T0/10000000 -Cjet
  10. gmt coast -Glightgray
  11. gmt plot tmp.txt -W -Sc0.1c -C
  12. # Plot mean population
  13. gmt subplot set 1 -Aa
  14. gmt binstats -I15 tmp.txt -W -Ca -Gt.grd -Tr -fg
  15. gmt grdimage t.grd -JQ70E/3i
  16. # Plot MAD population
  17. gmt subplot set 2 -Ad
  18. gmt binstats -I15 tmp.txt -W -Cd -Gt.grd -Tr -fg
  19. gmt grdimage t.grd
  20. # Plot stdev population
  21. gmt subplot set 3 -As
  22. gmt binstats -I15 tmp.txt -W -Cs -Gt.grd -Tr -fg
  23. gmt grdimage t.grd
  24. # Plot inter-quartile range population
  25. gmt subplot set 4 -Ai
  26. gmt binstats -I15 tmp.txt -W -Ci -Gt.grd -Tr -fg
  27. gmt grdimage t.grd
  28. # Plot minimum population
  29. gmt subplot set 5 -Al
  30. gmt binstats -I15 tmp.txt -W -Cl -Gt.grd -Tr -fg
  31. gmt grdimage t.grd
  32. # Plot median population
  33. gmt subplot set 6 -Am
  34. gmt binstats -I15 tmp.txt -W -Cm -Gt.grd -Tr -fg
  35. gmt grdimage t.grd
  36. # Plot number of points
  37. gmt subplot set 7 -An
  38. gmt binstats -I15 @capitals.gmt -Cn -Gt.grd -Tr -fg
  39. gmt grdimage t.grd
  40. # Plot LMSscale population
  41. gmt subplot set 8 -Ao
  42. gmt binstats -I15 tmp.txt -W -Co -Gt.grd -Tr -fg
  43. gmt grdimage t.grd
  44. # Plot mode population
  45. gmt subplot set 9 -Ap
  46. gmt binstats -I15 tmp.txt -W -Cp -Gt.grd -Tr -fg
  47. gmt grdimage t.grd
  48. # Plot quantile 75 population
  49. gmt subplot set 10 -Aq75
  50. gmt binstats -I15 tmp.txt -W -Cq75 -Gt.grd -Tr -fg
  51. gmt grdimage t.grd
  52. # Plot range population
  53. gmt subplot set 11 -Ag
  54. gmt binstats -I15 tmp.txt -W -Cg -Gt.grd -Tr -fg
  55. gmt grdimage t.grd
  56. # Plot sum population
  57. gmt subplot set 12 -Az
  58. gmt binstats -I15 tmp.txt -W -Cz -Gt.grd -Tr -fg
  59. gmt grdimage t.grd
  60. # Plot maximum population
  61. gmt subplot set 13 -Au
  62. gmt binstats -I15 tmp.txt -W -Cu -Gt.grd -Tr -fg
  63. gmt grdimage t.grd
  64. gmt subplot end
  65. gmt end show
Tip!

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

Comments

Loading...