|
2 | 2 | Multi-parameter symbols
|
3 | 3 | -------------------------
|
4 | 4 |
|
5 |
| -The :meth:`pygmt.Figure.plot` method can plot individual multi-parameter symbols by passing |
6 |
| -the corresponding shortcuts listed below to the ``style`` parameter. Additionally, we must define |
7 |
| -the required parameters in a 2d list or numpy array (``[[parameters]]`` for a single symbol |
8 |
| -or ``[[parameters_1],[parameters_2],[parameters_i]]`` for several ones) or use an |
| 5 | +The :meth:`pygmt.Figure.plot` method can plot individual multi-parameter |
| 6 | +symbols by passing the corresponding shortcuts listed below to the ``style`` |
| 7 | +parameter. Additionally, we must define the required parameters in a 2d list or |
| 8 | +numpy array (``[[parameters]]`` for a single symbol or |
| 9 | +``[[parameters_1],[parameters_2],[parameters_i]]`` for several ones) or use an |
9 | 10 | appropriately formatted input file and pass it to ``data``.
|
10 | 11 |
|
11 | 12 | The following symbols are available:
|
|
14 | 15 | - **j**: rotated rectangle, ``[[lon, lat, direction, width, height]]``
|
15 | 16 | - **r**: rectangle, ``[[lon, lat, width, height]]``
|
16 | 17 | - **R**: rounded rectangle, ``[[lon, lat, width, height, radius]]``
|
17 |
| -- **w**: pie wedge, ``[[lon, lat, radius, startdir, stopdir]]``, the last two arguments are |
18 |
| - directions given in degrees counter-clockwise from horizontal |
19 |
| -
|
20 |
| -Upper-case versions **E**, **J**, and **W** are similar to **e**, **j** and **w** but expect geographic |
21 |
| -azimuths and distances. |
| 18 | +- **w**: pie wedge, ``[[lon, lat, radius, startdir, stopdir]]``, the last two |
| 19 | + arguments are directions given in degrees counter-clockwise from horizontal |
22 | 20 |
|
| 21 | +Upper-case versions **E**, **J**, and **W** are similar to **e**, **j** and |
| 22 | +**w** but expect geographic azimuths and distances. |
23 | 23 | """
|
24 | 24 |
|
25 |
| -import numpy as np |
26 | 25 | import pygmt
|
27 | 26 |
|
28 | 27 | fig = pygmt.Figure()
|
29 |
| - |
30 | 28 | fig.basemap(region=[0, 6, 0, 2], projection="x3c", frame=True)
|
31 | 29 |
|
32 |
| -################### |
33 | 30 | # ELLIPSE
|
34 |
| -data = np.array([[0.5, 1, 45, 3, 1]]) |
35 |
| - |
| 31 | +data = [[0.5, 1, 45, 3, 1]] |
36 | 32 | fig.plot(data=data, style="e", color="orange", pen="2p,black")
|
37 | 33 |
|
38 |
| -################### |
39 | 34 | # ROTATED RECTANGLE
|
40 |
| -data = np.array([[1.5, 1, 120, 5, 0.5]]) |
41 |
| - |
| 35 | +data = [[1.5, 1, 120, 5, 0.5]] |
42 | 36 | fig.plot(data=data, style="j", color="red3", pen="2p,black")
|
43 | 37 |
|
44 |
| -################### |
45 | 38 | # RECTANGLE
|
46 |
| -data = np.array([[3, 1, 4, 1.5]]) |
47 |
| - |
| 39 | +data = [[3, 1, 4, 1.5]] |
48 | 40 | fig.plot(data=data, style="r", color="dodgerblue", pen="2p,black")
|
49 | 41 |
|
50 |
| -################### |
51 | 42 | # ROUNDED RECTANGLE
|
52 |
| -data = np.array([[4.5, 1, 1.25, 4, 0.5]]) |
53 |
| - |
| 43 | +data = [[4.5, 1, 1.25, 4, 0.5]] |
54 | 44 | fig.plot(data=data, style="R", color="seagreen", pen="2p,black")
|
55 | 45 |
|
56 |
| -################### |
57 | 46 | # PIE WEDGE
|
58 |
| -data = np.array([[5.5, 1, 2.5, 45, 330]]) |
59 |
| - |
| 47 | +data = [[5.5, 1, 2.5, 45, 330]] |
60 | 48 | fig.plot(data=data, style="w", color="lightgray", pen="2p,black")
|
61 | 49 |
|
62 | 50 | fig.show()
|
0 commit comments