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

geosegmentize.sh 1.6 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
  1. #!/usr/bin/env bash
  2. # Test segmentizing option -F in psxy with geographic data
  3. ps=geosegmentize.ps
  4. function plotpts
  5. { # Plots the two data tables and places given text
  6. gmt psxy -R -J -O -K -Sc0.2c -Ggreen -Wfaint t1.txt
  7. gmt psxy -R -J -O -K -Sc0.2c -Gblue -Wfaint t2.txt
  8. gmt pstext -R -J -O -K -F+cTL+jTL+f12p+t"$*" -Dj0.05i
  9. }
  10. cat << EOF > t1.txt
  11. 10 10
  12. 48 15
  13. 28 20
  14. >
  15. 40 40
  16. 30 5
  17. 5 15
  18. EOF
  19. cat << EOF > t2.txt
  20. 7 20
  21. 29 11
  22. 8 4
  23. EOF
  24. scl=0.06id
  25. gmt set MAP_FRAME_TYPE plain
  26. # Show the data and its natural connectivity
  27. gmt psxy -R0/50/0/45 -Jx${scl} -P -Ba10 -BWSne -W0.25p,- t[12].txt -K > $ps
  28. plotpts TWO DATA TABLES >> $ps
  29. # Lines from dataset origin
  30. gmt psxy -R -J -Ba10 -BwSnE -W0.25p,- t[12].txt -O -K -X3.25i >> $ps
  31. gmt psxy -R -J -W1p t[12].txt -Fra -O -K >> $ps
  32. plotpts DATASET ORIGIN >> $ps
  33. # Lines from table origin
  34. gmt psxy -R -Jx${scl} -Ba10 -BWSne -W0.25p,- t[12].txt -O -K -X-3.25i -Y3.15i >> $ps
  35. gmt psxy -R -J -W1p t[12].txt -Frf -O -K >> $ps
  36. plotpts TABLE ORIGIN >> $ps
  37. # Lines from segment origin
  38. gmt psxy -R -J -Ba10 -BwSnE -W0.25p,- t[12].txt -O -K -X3.25i >> $ps
  39. gmt psxy -R -J -W1p t[12].txt -Frs -O -K >> $ps
  40. plotpts SEGMENT ORIGIN >> $ps
  41. # Lines from fixed origin
  42. gmt psxy -R -J -Ba10 -BWSne -W0.25p,- t[12].txt -O -K -X-3.25i -Y3.15i >> $ps
  43. gmt psxy -R -J -W1p t[12].txt -Fr10/35 -O -K >> $ps
  44. plotpts FIXED ORIGIN >> $ps
  45. echo 10 35 | gmt psxy -R -J -O -K -Sa0.4c -Gred -Wfaint >> $ps
  46. # Lines for network
  47. gmt psxy -R -J -Ba10 -BwSnE -W0.25p,- t[12].txt -O -K -X3.25i >> $ps
  48. gmt psxy -R -J -W1p t[12].txt -Fna -O -K >> $ps
  49. plotpts NETWORK >> $ps
  50. gmt psxy -R -J -O -T >> $ps
Tip!

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

Comments

Loading...