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

boxtext.sh 760 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
  1. #!/usr/bin/env bash
  2. # Compare the size and alignment of identical text plotted in different ways:
  3. # (lower): Plain text with box and margin
  4. # (upper): Plain text with textbox clip path, then red paint
  5. ps=boxtext.ps
  6. gmt set PS_COMMENTS true
  7. gmt pstext -R0/6/0/4 -Jx1i -Ba1 -P -Dj0.5i/0.5i -F+f32p+jLB -Gyellow -W0.25p,green -K -C1c+tO << EOF > $ps
  8. 2 2 TEXT
  9. EOF
  10. gmt pstext -R -J -O -K -Dj0.5i/0.5i -F+f32p+jLB -Gc -C1c+tO -Y5i << EOF >> $ps
  11. 2 2 TEXT
  12. EOF
  13. gmt psxy -R -J -O -K -Sri -Gred << EOF >> $ps
  14. 3 2 6 4
  15. EOF
  16. gmt psclip -R -J -C -O -K >> $ps
  17. # Plot alignment lines to highlight misalignment
  18. gmt psxy -R0/6/0/9 -Jx1i -O -Y-5i -W0.5p,blue << EOF >> $ps
  19. >
  20. 2.115 0
  21. 2.115 9
  22. >
  23. 4.025 0
  24. 4.025 9
  25. >
  26. 0 2.105
  27. 6 2.105
  28. >
  29. 0 3.22
  30. 6 3.22
  31. >
  32. 0 7.105
  33. 6 7.105
  34. >
  35. 0 8.22
  36. 6 8.22
  37. EOF
Tip!

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

Comments

Loading...