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

categoricalcpt.sh 588 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
  1. #!/usr/bin/env bash
  2. # See issue # 3766. Fixed in #4407
  3. # Only actual categorical values will get a color and bad values are given NaN color
  4. # Also, the back/foreground triangles are not accessible for categorical CPTs
  5. gmt begin categoricalcpt ps
  6. cat > types.cpt << EOF
  7. 0 yellow ;desert
  8. 1 blue ;forest
  9. 2 red ;iceland
  10. B white
  11. F black
  12. N gray
  13. EOF
  14. cat << EOF > tmp.txt
  15. 1 3 -1
  16. 2 3 0
  17. 3 3 1
  18. 4 3 1.5
  19. 5 3 2
  20. 6 3 2.01
  21. 7 3 3
  22. 8 3 3.1
  23. 9 3 NaN
  24. EOF
  25. gmt plot -R0/10/0/6 -Jx1.5c -Baf -BWSen -Sc1c -W1p -Ctypes.cpt tmp.txt
  26. gmt text -F+f12p -D0/1c tmp.txt
  27. gmt colorbar -Ctypes.cpt -DJBC+e+n
  28. gmt end show
Tip!

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

Comments

Loading...