Skip to content

Commit ad5abe3

Browse files
authored
Merge pull request #157 from zmoon/doc
Add links in plotting docstrings
2 parents 2893337 + d57f728 commit ad5abe3

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def __getattr__(cls, name):
7979
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
8080
"numpy": ("https://numpy.org/doc/stable/", None),
8181
"monetio": ("https://monetio.readthedocs.io/en/stable/", None),
82+
"matplotlib": ("https://matplotlib.org/stable/", None),
8283
}
8384

8485

monet/monet_accessor.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -960,21 +960,20 @@ def _check_kwargs_and_set_defaults(**kwargs):
960960
return kwargs
961961

962962
def quick_imshow(self, map_kws=None, roll_dateline=False, **kwargs):
963-
"""This function takes an xarray DataArray and quickly creates a figure
964-
using cartopy and matplotlib ``imshow``.
963+
"""Quickly create a geo-referenced image plot using Cartopy and Matplotlib.
965964
966-
Note that this should only be used for regular grids.
965+
Note that this should only be used for regular grids (e.g. rectangular lat/lon grid).
967966
968967
Parameters
969968
----------
970-
map_kws : dictionary
971-
kwargs for monet.plots.mapgen.draw_map
969+
map_kws : dict
970+
kwargs for :func:`monet.plots.mapgen.draw_map`
972971
roll_dateline : bool
973-
roll_dateline is meant to help with global datasets that the longitudes
972+
`roll_dateline` is meant to help with global datasets that the longitudes
974973
range from 0 to 360 instead of -180 to 180. Otherwise a white line appears
975974
at 0 degrees.
976975
**kwargs :
977-
kwargs for the xarray.DataArray.plot.imshow function
976+
kwargs for :meth:`xarray.DataArray.plot.imshow`
978977
979978
Returns
980979
-------
@@ -1028,19 +1027,19 @@ def quick_imshow(self, map_kws=None, roll_dateline=False, **kwargs):
10281027
return ax
10291028

10301029
def quick_map(self, map_kws=None, roll_dateline=False, **kwargs):
1031-
"""This function takes an xarray DataArray and quickly creates a figure
1032-
using cartopy and matplotlib ``pcolormesh``.
1030+
"""Quickly create a geo-referenced plot using Cartopy and Matplotlib.
10331031
10341032
Parameters
10351033
----------
1036-
map_kws : dictionary
1037-
kwargs for monet.plots.mapgen.draw_map
1034+
map_kws : dict
1035+
kwargs for :func:`monet.plots.mapgen.draw_map`
10381036
roll_dateline : bool
1039-
roll_dateline is meant to help with global datasets that the longitudes
1037+
`roll_dateline` is meant to help with global datasets that the longitudes
10401038
range from 0 to 360 instead of -180 to 180. Otherwise a white line appears
10411039
at 0 degrees.
10421040
**kwargs :
1043-
kwargs for the xarray.DataArray.plot.pcolormesh function
1041+
kwargs for :meth:`xarray.DataArray.plot.pcolormesh`
1042+
(actually passed to :meth:`xarray.DataArray.plot`, but pcolormesh is the usual result)
10441043
10451044
Returns
10461045
-------
@@ -1087,19 +1086,18 @@ def quick_map(self, map_kws=None, roll_dateline=False, **kwargs):
10871086
return ax
10881087

10891088
def quick_contourf(self, map_kws=None, roll_dateline=False, **kwargs):
1090-
"""This function takes an xarray DataArray and quickly creates a figure
1091-
using cartopy and matplotlib ``contourf``.
1089+
"""Quickly create a geo-referenced filled-contour plot using Cartopy and Matplotlib.
10921090
10931091
Parameters
10941092
----------
1095-
map_kws : dictionary
1096-
kwargs for monet.plots.mapgen.draw_map
1093+
map_kws : dict
1094+
kwargs for :func:`monet.plots.mapgen.draw_map`
10971095
roll_dateline : bool
1098-
roll_dateline is meant to help with global datasets that the longitudes
1096+
`roll_dateline` is meant to help with global datasets that the longitudes
10991097
range from 0 to 360 instead of -180 to 180. Otherwise a white line appears
11001098
at 0 degrees.
11011099
**kwargs :
1102-
kwargs for the xarray.DataArray.plot.contourf function
1100+
kwargs for :meth:`xarray.DataArray.plot.contourf`
11031101
11041102
Returns
11051103
-------

monet/plots/mapgen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ def draw_map(
4444
extent : array-like
4545
Set the map extent with ``[lon_min,lon_max,lat_min,lat_max]``.
4646
figsize : tuple
47-
Figure size (width, height), passed to ``plt.subplots()``.
47+
Figure size (width, height), passed to :func:`plt.subplots() <matplotlib.pyplot.subplots>`.
4848
This takes precedence over the possible ``kwargs['figsize']``.
4949
linewidth : float
5050
Line width for coastlines, states, counties, and countries.
5151
return_fig : bool
5252
Return the figure and axes objects.
5353
By default (``False``), just the axes object is returned.
5454
**kwargs
55-
Arguments pass to ``plt.subplots()``.
55+
Arguments to pass to :func:`plt.subplots() <matplotlib.pyplot.subplots>`.
5656
5757
Returns
5858
-------

0 commit comments

Comments
 (0)