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

categorical.sh 1.1 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
  1. #!/bin/bash
  2. #
  3. # $Id$
  4. . ../functions.sh
  5. header "Test grdview for categorical grid plots"
  6. ps=categorical.ps
  7. # The cpt
  8. cat << EOF > $$.cpt
  9. 1 red 2 red ;A
  10. 2 green 3 green ;B
  11. 3 blue 4 blue ;C
  12. 4 yellow 5 yellow ;D
  13. 5 brown 6 brown ;E
  14. B black
  15. F white
  16. N gray
  17. EOF
  18. # The categorical data grid
  19. cat << EOF | xyz2grd -R0/10/50/60 -I5 -G$$.nc
  20. 0 60 1
  21. 5 60 1
  22. 10 60 2
  23. 0 55 1
  24. 5 55 2
  25. 10 55 2
  26. 0 50 2
  27. 5 50 5
  28. 10 50 5
  29. EOF
  30. #
  31. # First plot as normal image using surface -Qs:
  32. grdview $$.nc -C$$.cpt -JU31/2.75 -P -B5g5:."-Qs":WSne -Qs -K --MAP_TITLE_OFFSET=-1i > $ps
  33. # Then plot as texture tiles -Ts:
  34. grdview $$.nc -C$$.cpt -J -O -K -B5g5:."-T":WSne -T -X3.5 --MAP_TITLE_OFFSET=-1i >> $ps
  35. psscale -C$$.cpt -D3/3/1.5/0.2 -O -K -L0.1i >> $ps
  36. # Then plot as image -Qi100
  37. grdview $$.nc -C$$.cpt -J -O -K -B5g5:."-Qi100":WSne -Qi100 -X-3.5 -Y5.0 --MAP_TITLE_OFFSET=-1i >> $ps
  38. # Finally plot as texture image -Qt100
  39. grdview $$.nc -C$$.cpt -J -O -B5g5:."-Qt100":WSne -Qt100 -X3.5 --MAP_TITLE_OFFSET=-1i >> $ps
  40. rm -f $$.*
  41. pscmp
Tip!

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

Comments

Loading...