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

ex19.sh 1.7 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
  1. #!/usr/bin/env bash
  2. # GMT EXAMPLE 19
  3. #
  4. # Purpose: Illustrates various color pattern effects for maps
  5. # GMT modules: grdimage, grdmath, makecpt, coast, text, image, makecpt
  6. # Unix progs: echo, rm
  7. gmt begin ex19
  8. gmt grdmath -Rd -I1 -r Y COSD 2 POW = lat.nc
  9. gmt grdmath X = lon.nc
  10. gmt makecpt -Cwhite,blue -T0/1 -N -H > lat.cpt
  11. gmt makecpt -Crainbow -T-180/180 -H > lon.cpt
  12. gmt subplot begin 3x1 -Fs16c/0 -M0 -Bbltr -Rd -JI0/16c
  13. # First make a worldmap with graded blue oceans and rainbow continents
  14. gmt grdimage lat.nc -Clat.cpt -nl -c0,0
  15. gmt coast -Dc -A5000 -G
  16. gmt grdimage lon.nc -Clon.cpt -nl
  17. gmt coast -Q
  18. gmt coast -Dc -A5000 -Wthinnest
  19. echo "0 20 17TH INTERNATIONAL" | gmt text -F+f32p,Helvetica-Bold,red=thinner
  20. echo "0 -10 GMT CONFERENCE" | gmt text -F+f32p,Helvetica-Bold,red=thinner
  21. echo "0 -30 Honolulu, Hawaii, April 1, 2021" | gmt text -F+f18p,Helvetica-Bold,green=thinnest
  22. # Then show example of color patterns and placing a PostScript image
  23. gmt coast -Dc -A5000 -Gp86+fred+byellow+r100 -Sp@circuit.png+r100 -c1,0
  24. echo "0 30 SILLY USES OF" | gmt text -F+f32p,Helvetica-Bold,lightgreen=thinner
  25. echo "0 -30 COLOR PATTERNS" | gmt text -F+f32p,Helvetica-Bold,magenta=thinner
  26. gmt image -DjCM+w7.5c @GMT_covertext.eps
  27. # Finally repeat 1st plot but exchange the colors
  28. gmt grdimage lon.nc -Clon.cpt -nl -c2,0
  29. gmt coast -Dc -A5000 -G
  30. gmt grdimage lat.nc -Clat.cpt -nl
  31. gmt coast -Q
  32. gmt coast -Dc -A5000 -Wthinnest
  33. echo "0 20 17TH INTERNATIONAL" | gmt text -F+f32p,Helvetica-Bold,red=thinner
  34. echo "0 -10 GMT CONFERENCE" | gmt text -F+f32p,Helvetica-Bold,red=thinner
  35. echo "0 -30 Honolulu, Hawaii, April 1, 2021" | gmt text -F+f18p,Helvetica-Bold,green=thinnest
  36. gmt subplot end
  37. gmt end show
  38. rm -f lat.nc lon.nc lat.cpt lon.cpt
Tip!

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

Comments

Loading...