Skip to content

Commit 231a953

Browse files
authored
Tiny improvements for the multi-parameter symbols example (#1050)
1 parent a0840a6 commit 231a953

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

examples/gallery/symbols/multi_parameter_symbols.py

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
Multi-parameter symbols
33
-------------------------
44
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
910
appropriately formatted input file and pass it to ``data``.
1011
1112
The following symbols are available:
@@ -14,49 +15,36 @@
1415
- **j**: rotated rectangle, ``[[lon, lat, direction, width, height]]``
1516
- **r**: rectangle, ``[[lon, lat, width, height]]``
1617
- **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
2220
21+
Upper-case versions **E**, **J**, and **W** are similar to **e**, **j** and
22+
**w** but expect geographic azimuths and distances.
2323
"""
2424

25-
import numpy as np
2625
import pygmt
2726

2827
fig = pygmt.Figure()
29-
3028
fig.basemap(region=[0, 6, 0, 2], projection="x3c", frame=True)
3129

32-
###################
3330
# ELLIPSE
34-
data = np.array([[0.5, 1, 45, 3, 1]])
35-
31+
data = [[0.5, 1, 45, 3, 1]]
3632
fig.plot(data=data, style="e", color="orange", pen="2p,black")
3733

38-
###################
3934
# ROTATED RECTANGLE
40-
data = np.array([[1.5, 1, 120, 5, 0.5]])
41-
35+
data = [[1.5, 1, 120, 5, 0.5]]
4236
fig.plot(data=data, style="j", color="red3", pen="2p,black")
4337

44-
###################
4538
# RECTANGLE
46-
data = np.array([[3, 1, 4, 1.5]])
47-
39+
data = [[3, 1, 4, 1.5]]
4840
fig.plot(data=data, style="r", color="dodgerblue", pen="2p,black")
4941

50-
###################
5142
# 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]]
5444
fig.plot(data=data, style="R", color="seagreen", pen="2p,black")
5545

56-
###################
5746
# PIE WEDGE
58-
data = np.array([[5.5, 1, 2.5, 45, 330]])
59-
47+
data = [[5.5, 1, 2.5, 45, 330]]
6048
fig.plot(data=data, style="w", color="lightgray", pen="2p,black")
6149

6250
fig.show()

0 commit comments

Comments
 (0)