From 6ec1da202e5abaf317f49ba8dda348ef572b279d Mon Sep 17 00:00:00 2001 From: keewis Date: Mon, 23 Sep 2019 03:08:42 +0200 Subject: [PATCH] More doc fixes (#3333) * fix a code section being hidden * fix the code samples of DataArray.plot * fix a cross-reference --- doc/api.rst | 2 +- doc/reshaping.rst | 1 + xarray/core/dataarray.py | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/api.rst b/doc/api.rst index 9b3d6dfaf95..256a1dbf3af 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -8,7 +8,7 @@ This page provides an auto-generated summary of xarray's API. For more details and examples, refer to the relevant chapters in the main part of the documentation. -See also: :ref:`public api`_. +See also: :ref:`public api` Top-level functions =================== diff --git a/doc/reshaping.rst b/doc/reshaping.rst index b3abfc5afb0..51202f9be41 100644 --- a/doc/reshaping.rst +++ b/doc/reshaping.rst @@ -156,6 +156,7 @@ represented by a :py:class:`pandas.MultiIndex` object. These methods are used like this: .. ipython:: python + data = xr.Dataset( data_vars={'a': (('x', 'y'), [[0, 1, 2], [3, 4, 5]]), 'b': ('x', [6, 7])}, diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index add2b1b6c01..e63b6c9975f 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -2558,10 +2558,12 @@ def plot(self) -> _PlotMethods: >>> d = DataArray([[1, 2], [3, 4]]) For convenience just call this directly + >>> d.plot() Or use it as a namespace to use xarray.plot functions as DataArray methods + >>> d.plot.imshow() # equivalent to xarray.plot.imshow(d) """