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

table.sh 2.3 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
  1. #!/usr/bin/env bash
  2. #
  3. # Testing gmt pslegend capabilities for tables with colors
  4. ps=table.ps
  5. gmt set FONT_ANNOT_PRIMARY 12p FONT_LABEL 12p
  6. cat <<EOF > table.txt
  7. # Legend test for gmt pslegend
  8. # G is vertical gap, V is vertical line, N sets # of columns, D draws horizontal line,
  9. #
  10. G 0.04i
  11. H 24p,Times-Roman Eight Largest Cities in North America
  12. D 1p
  13. N 6 22 16 20 20 8 8
  14. V 0.25p
  15. S 0.15i c 0.1i snow1 -
  16. L - C City Name
  17. L - C Country
  18. L - C Population
  19. L - C Climate
  20. L - C WC?
  21. L - C OL?
  22. D 0 1p
  23. F lightgreen
  24. S 0.15i c 0.1i red 0.25p
  25. L - R Mexico City
  26. L - R Mexico
  27. L - R 8,851,080
  28. L - R Tropical
  29. L - C Y
  30. L - C Y
  31. F -
  32. S 0.15i c 0.1i orange 0.25p
  33. L - R New York City
  34. L - R USA
  35. L - R 8,405,837
  36. L - R Tempered
  37. L - C Y
  38. L - C N
  39. S 0.15i c 0.1i yellow 0.25p
  40. L - R Los Angeles
  41. L - R USA
  42. L - R 3,904,657
  43. L - R Subtropical
  44. L - C Y
  45. L - C Y
  46. F lightblue
  47. S 0.15i c 0.1i green 0.25p
  48. L - R Toronto
  49. L - R Canada
  50. L - R 2,795,060
  51. L - R Tempered
  52. L - C N
  53. L - C N
  54. F -
  55. S 0.15i c 0.1i blue 0.25p
  56. L - R Chicago
  57. L - R USA
  58. L - R 2,714,856
  59. L - R Tempered
  60. L - C Y
  61. L - C N
  62. S 0.15i c 0.1i cyan 0.25p
  63. L - R Houston
  64. L - R USA
  65. L - R 2,714,856
  66. L - R subtropical
  67. L - C N
  68. L - C N
  69. F lightred
  70. S 0.15i c 0.1i magenta 0.25p
  71. L - R Havana
  72. L - R Cuba
  73. L - R 2,106,146
  74. L - R Tropical
  75. L - C N
  76. L - C N
  77. F lightblue
  78. S 0.15i c 0.1i white 0.25p
  79. L - R Montreal
  80. L - R Canada
  81. L - R 1,649,519
  82. L - R Tempered
  83. L - C N
  84. L - C Y
  85. D 1p
  86. V 1p
  87. F -
  88. N 1
  89. L 9p,Times-Roman R Information from Wikipedia
  90. G 0.05i
  91. T Many of these cities have hosted World Cup Soccer (WC) and some
  92. T have hosted the Olympics (OL). The rest is just some basic information
  93. T about each city, such as climate and population. Of course, this is all
  94. T an excuse to demonstrate variable-width tables and coloring.
  95. G 0.1i
  96. EOF
  97. cat << EOF > t.cpt
  98. 1 red
  99. 2 orange
  100. 3 yellow
  101. 4 green
  102. 5 blue
  103. 6 cyan
  104. 7 magenta
  105. 8 white
  106. EOF
  107. gmt pscoast -R130W/50W/10N/55N -JM5.6i -Bf -P -K -Gbisque -N1/1p,darkred -Wfaint -Sazure1 -A1000 -Xc -Y1.1i --MAP_FRAME_TYPE=plain > $ps
  108. gmt psxy -R -J -O -K -Sc0.1i -Ct.cpt -W0.25p -: << EOF >> $ps
  109. 19.4333N, 99.1333W 1
  110. 40.7127N, 74.0059W 2
  111. 34.0500N, 118.2500W 3
  112. 43.7000N, 79.4000W 4
  113. 41.8819N, 87.6278W 5
  114. 29.7628N, 95.3831W 6
  115. 23.1333N, 82.3833W 7
  116. 45.5000N, 73.5667W 8
  117. EOF
  118. gmt pslegend -R0/6/0/8 -Jx1i -Dx3i/4.2i+w5.6i+jBC+l1.2 -C0.05i -F+p+gsnow1 -B0 -X-0.2i -Y-0.1i -O table.txt >> $ps
  119. rm -f table.txt t.cpt
Tip!

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

Comments

Loading...