Skip to content

Commit 0b0cbbf

Browse files
committed
Explain the acceptable data formats, levels, and annotation parameters.
1 parent b0a0908 commit 0b0cbbf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

examples/gallery/lines/contours.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
"""
22
Contours
33
--------
4-
The :meth:`pygmt.Figure.contour` method can plot contour lines from a table of points.
4+
The :meth:`pygmt.Figure.contour` method can plot contour lines from a table of points by direct triangulation.
5+
The data to the triangulation can by provided in one of three options:
6+
1: ``x``, ``y``, ``z`` 1d data columns
7+
2: ``data`` 2d data matrix with 3 columns corresponding to ``x``, ``y``, ``z``
8+
3: ''data'' path string to a file containing the ``x``, ``y``, ``z`` in a tabular format
9+
The parameters ``levels`` and ``annotation`` are deciding on the contours intervals and intervals of the
10+
annotation on the contours
511
"""
612

713

@@ -12,6 +18,7 @@
1218
Z = X**2 + Y**2
1319
x, y, z = X.flatten(), Y.flatten(), Z.flatten()
1420

21+
1522
fig = pygmt.Figure()
1623
fig.contour(
1724
region=[-10, 10, -10, 10],
@@ -20,6 +27,8 @@
2027
x=x,
2128
y=y,
2229
z=z,
30+
levels=5,
31+
annotation=20,
2332
pen=1
2433
)
2534
fig.show()

0 commit comments

Comments
 (0)