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

condcust_symbol.sh 999 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
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
  1. #!/usr/bin/env bash
  2. # Test custom symbol with conditional statements. From Kristof
  3. # http://gmt.soest.hawaii.edu/boards/1/topics/7399
  4. ps=condcust_symbol.ps
  5. cat << EOF > sample_data.txt
  6. # Just some test data
  7. # LON LAT SIZE LAT2 VALUE
  8. 118 2 1 2 10
  9. 119 2 1 2 20
  10. 120 2 1 2 30
  11. 121 2 1 2 40
  12. 122 2 1 2 50
  13. 118 1 1 1 60
  14. 119 1 1 1 70
  15. 120 1 1 1 80
  16. 121 1 1 1 90
  17. 122 1 1 1 100
  18. 118 0 1 0 110
  19. 119 0 1 0 120
  20. 120 0 1 0 130
  21. 121 0 1 0 140
  22. 122 0 1 0 150
  23. 118 -1 1 -1 160
  24. 119 -1 1 -1 170
  25. 120 -1 1 -1 10
  26. 121 -1 1 -1 20
  27. 122 -1 1 -1 30
  28. EOF
  29. cat << EOF > cond_test_symbol.def
  30. N: 2 oo
  31. if \$1 >= 0 then {
  32. if \$2 > 100 then {
  33. 0 0 0.5 c -W1p,black -G-
  34. } elseif \$2 > 50 then {
  35. 0 0 0.5 d -W1p,blue -G-
  36. } else {
  37. 0 0 0.5 a -W1p,orange -G-
  38. }
  39. 0 0 1 c -W1p,red -G-
  40. } else {
  41. 0 0 1 c -W1p,green -G-
  42. }
  43. EOF
  44. gmt pscoast -R117/-1.5/122.5/3+r -JM15c -Bag -Di -Ggrey -Wthinnest -A250 -P -K -Xc > $ps
  45. gmt psxy -R -J sample_data.txt -Skcond_test_symbol -O --PROJ_LENGTH_UNIT=cm >> $ps
Tip!

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

Comments

Loading...