|
2 | 2 | Custom symbols
|
3 | 3 | ==============
|
4 | 4 |
|
5 |
| -The :meth:`pygmt.Figure.plot` method can plot individual custom symbols |
6 |
| -by passing the corresponding symbol name together with the **k** shortcut to |
7 |
| -the ``style`` parameter. In total 41 custom symbols are already included of |
8 |
| -which the following plot shows five exemplary ones. The symbols are shown |
9 |
| -underneath their corresponding names. For the remaining symbols see the GMT |
10 |
| -Technical Reference :gmt-docs:`reference/custom-symbols.html`. |
| 5 | +The :meth:`pygmt.Figure.plot` method can plot individual custom symbols by |
| 6 | +passing the corresponding symbol name together with the **k** shortcut to the |
| 7 | +``style`` parameter. |
| 8 | +
|
| 9 | +In total 41 custom symbols are already included of which the following plot shows |
| 10 | +five exemplary ones. The symbols are shown underneath their corresponding names. |
| 11 | +For the remaining symbols see the GMT Technical Reference |
| 12 | +:gmt-docs:`reference/custom-symbols.html`. |
| 13 | +
|
| 14 | +Beside these built-in custom symbols GMT allows users to define their own custom |
| 15 | +symbols. For this, a specific macro language is used. A detailed introduction can |
| 16 | +be found at :gmt-docs:`reference/custom-symbols.html#the-macro-language`. After |
| 17 | +defining such a symbol it can be used in the same way as a built-in custom symbol. |
| 18 | +
|
| 19 | +*Please note*: Custom symbols can not be used in auto-legends yet. |
11 | 20 | """
|
12 | 21 |
|
13 | 22 | # %%
|
|
16 | 25 | fig = pygmt.Figure()
|
17 | 26 | fig.basemap(region=[0, 8, 0, 3], projection="X12c/4c", frame=True)
|
18 | 27 |
|
19 |
| -# define pen and fontstyle for annotations |
| 28 | +# Define pen and fontstyle for annotations |
20 | 29 | pen = "1p,black"
|
21 | 30 | font = "15p,Helvetica-Bold"
|
22 | 31 |
|
23 |
| -# use the volcano symbol with a size of 1.5c, |
24 |
| -# fill color is set to "seagreen" |
| 32 | +# Use the volcano symbol with a size of 1.5c, fill color is set to "seagreen" |
25 | 33 | fig.plot(x=1, y=1.25, style="kvolcano/1.5c", pen=pen, fill="seagreen")
|
26 | 34 | fig.text(x=1, y=2.5, text="volcano", font=font)
|
27 | 35 |
|
28 |
| -# use the astroid symbol with a size of 1.5c, |
29 |
| -# fill color is set to "red3" |
| 36 | +# Use the astroid symbol with a size of 1.5c, fill color is set to "red3" |
30 | 37 | fig.plot(x=2.5, y=1.25, style="kastroid/1.5c", pen=pen, fill="red3")
|
31 | 38 | fig.text(x=2.5, y=2.5, text="astroid", font=font)
|
32 | 39 |
|
33 |
| -# use the flash symbol with a size of 1.5c, |
34 |
| -# fill color is set to "darkorange" |
| 40 | +# Use the flash symbol with a size of 1.5c, fill color is set to "darkorange" |
35 | 41 | fig.plot(x=4, y=1.25, style="kflash/1.5c", pen=pen, fill="darkorange")
|
36 | 42 | fig.text(x=4, y=2.5, text="flash", font=font)
|
37 | 43 |
|
38 |
| -# use the star4 symbol with a size of 1.5c, |
39 |
| -# fill color is set to "dodgerblue4" |
| 44 | +# Use the star4 symbol with a size of 1.5c, fill color is set to "dodgerblue4" |
40 | 45 | fig.plot(x=5.5, y=1.25, style="kstar4/1.5c", pen=pen, fill="dodgerblue4")
|
41 | 46 | fig.text(x=5.5, y=2.5, text="star4", font=font)
|
42 | 47 |
|
43 |
| -# use the hurricane symbol with a size of 1.5c, |
44 |
| -# fill color is set to "magenta4" |
| 48 | +# Use the hurricane symbol with a size of 1.5c, fill color is set to "magenta4" |
45 | 49 | fig.plot(x=7, y=1.25, style="khurricane/1.5c", pen=pen, fill="magenta4")
|
46 | 50 | fig.text(x=7, y=2.5, text="hurricane", font=font)
|
47 | 51 |
|
|
0 commit comments