Skip to content

Commit e3c249e

Browse files
committed
Add documentation for pymodalib.plotting
1 parent 59e5f98 commit e3c249e

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The following table displays the most important modules from PyMODAlib. To view
1818
pymodalib.algorithms.signals
1919
pymodalib.algorithms.wavelet
2020
pymodalib.algorithms.windowed_fourier
21+
pymodalib.plotting
2122

2223
.. toctree::
2324
:maxdepth: 2

pymodalib/plotting/__init__.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
"""
17+
Functions for plotting the results of PyMODAlib algorithms.
18+
"""
1619
import warnings
1720

1821
import numpy as np
@@ -32,9 +35,12 @@ def contourf(
3235
**kwargs
3336
) -> "matplotlib.contour.QuadContourSet":
3437
"""
35-
Plots a contour plot in PyMODA style. Useful for easily plotting a wavelet transform, etc.
38+
Plots a contour plot in PyMODA style. Useful for easily plotting a wavelet transform.
3639
37-
This function is a Wrapper around matplotlib's 'contourf'.
40+
This function is a wrapper around matplotlib's 'contourf'.
41+
42+
.. note::
43+
Most of this documentation was copied from the relevant matplotlib function, `matplotlib.pyplot.contourf`.
3844
3945
Parameters
4046
----------
@@ -54,14 +60,21 @@ def contourf(
5460
If an int n, use n data intervals; i.e. draw n+1 contour lines. The level heights are automatically chosen.
5561
5662
If array-like, draw contour lines at the specified levels. The values must be in increasing order.
63+
vmin : float, None
64+
The minimum value, used to calibrate the colormap. If None, the minimum value of the array will be used.
65+
vmax : float, None
66+
The maximum value, used to calibrate the colormap. If None, the maximum value of the array will be used.
67+
cmap : str, Colormap, None
68+
The colormap to use. If left to None, the PyMODAlib colormap will be used.
69+
*args : optional
70+
Arguments to pass to matplotlib's `contourf` function.
71+
*kwargs : optional
72+
Keyword arguments to pass to matplotlib's `contourf` function.
5773
5874
Returns
5975
-------
6076
matplotlib.contour.QuadContourSet
6177
The value returned by matplotlib's `contourf`.
62-
63-
.. note::
64-
Documentation copied from the relevant matplotlib function, `matplotlib.pyplot.contourf`.
6578
"""
6679
if vmin is None:
6780
vmin = np.nanmin(z)

0 commit comments

Comments
 (0)