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

legend.rst 3.0 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
  1. .. index:: ! legend
  2. .. include:: module_core_purpose.rst_
  3. ********
  4. legend
  5. ********
  6. |legend_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt legend** [ *specfile* ]
  11. |-D|\ *refpoint*
  12. [ |SYN_OPT-B| ]
  13. [ |-C|\ *dx*/*dy* ]
  14. [ |-F|\ *box* ]
  15. [ |-J|\ *parameters* ]
  16. [ |SYN_OPT-R| ]
  17. [ |-S|\ *scale* ]
  18. [ |-T|\ *file* ]
  19. [ |SYN_OPT-U| ]
  20. [ |SYN_OPT-V| ]
  21. [ |SYN_OPT-X| ]
  22. [ |SYN_OPT-Y| ]
  23. [ |SYN_OPT-p| ]
  24. [ |SYN_OPT-qi| ]
  25. [ |SYN_OPT-t| ]
  26. [ |SYN_OPT--| ]
  27. .. include:: legend_common.rst_
  28. Examples
  29. --------
  30. .. include:: explain_example.rst_
  31. .. include:: oneliner_info.rst_
  32. To add an example of a legend to a Mercator plot (map.ps) with the given
  33. specifications, use::
  34. gmt begin legend
  35. gmt makecpt -Cpanoply -T-8/8 -H > tt.cpt
  36. gmt set FONT_ANNOT_PRIMARY 12p
  37. gmt legend -R0/10/0/10 -JM6i -Dx0.5i/0.5i+w5i+jBL+l1.2 -C0.1i/0.1i -F+p+gazure1+r -B5f1 << EOF
  38. # Legend test for gmt pslegend
  39. # G is vertical gap, V is vertical line, N sets # of columns, D draws horizontal line,
  40. # H is ps=legend.ps
  41. #
  42. G -0.1i
  43. H 24p,Times-Roman My Map Legend
  44. D 0.2i 1p
  45. N 2
  46. V 0 1p
  47. S 0.1i c 0.15i p300/12 0.25p 0.3i This circle is hachured
  48. S 0.1i e 0.15i yellow 0.25p 0.3i This ellipse is yellow
  49. S 0.1i w 0.15i green 0.25p 0.3i This wedge is green
  50. S 0.1i f 0.25i blue 0.25p 0.3i This is a fault
  51. S 0.1i - 0.15i - 0.25p,- 0.3i A contour
  52. S 0.1i v 0.25i magenta 0.5p 0.3i This is a vector
  53. S 0.1i i 0.15i cyan 0.25p 0.3i This triangle is boring
  54. D 0.2i 1p
  55. V 0 1p
  56. N 1
  57. M 5 5 600+u+f
  58. G 0.05i
  59. I @SOEST_block4.png 3i CT
  60. G 0.05i
  61. B tt.cpt 0.2i 0.2i -B0
  62. G 0.05i
  63. L 9p,Times-Roman R Smith et al., @%5%J. Geophys. Res., 99@%%, 2000
  64. G 0.1i
  65. T Let us just try some simple text that can go on a few lines.
  66. T There is no easy way to predetermine how many lines may be required
  67. T so we may have to adjust the height to get the right size box.
  68. EOF
  69. rm -f tt.cpt
  70. gmt end show
  71. Auto-legends
  72. ------------
  73. In modern mode, some modules can access the **-l** option and build the legend
  74. *specfile* from individual entries for each command. The **-l** option takes an optional
  75. label and allows optional modifiers **+d**, **+g**, **+n**, **+h**, **+j**, **+l**, and **+v**
  76. that follow the corresponding uppercase legend codes discussed above. In addition,
  77. there is **+f** to set header (H) or label (L) font, **+s** to set the symbol size (or line length)
  78. to use for the current entry, and **+x** to scale all symbols uniformly (see **-S** above).
  79. Some defaults are hardwired: We draw a white rectangular panel with
  80. a 1 point black outline offset from the justification point (**+j**) by 0.2 cm. To use
  81. different settings you must call **legend** explicitly before :doc:`end` does so
  82. implicitly instead. **Note**: With an explicit call to **legend** you can also use **-T** to
  83. save the auto-generate *specfile*, make modification to it, and then pass that to **legend**
  84. directly.
  85. See Also
  86. --------
  87. :doc:`gmt`, :doc:`gmt.conf`,
  88. :doc:`gmtcolors`, :doc:`gmtlogo`
  89. :doc:`basemap`, :doc:`text`,
  90. :doc:`plot`
Tip!

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

Comments

Loading...