You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/plotting.rst
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -487,6 +487,7 @@ Faceting here refers to splitting an array along one or two dimensions and
487
487
plotting each group.
488
488
xarray's basic plotting is useful for plotting two dimensional arrays. What
489
489
about three or four dimensional arrays? That's where facets become helpful.
490
+
The general approach to plotting here is called “small multiples”, where the same kind of plot is repeated multiple times, and the specific use of small multiples to display the same relationship conditioned on one ore more other variables is often called a “trellis plot”.
490
491
491
492
Consider the temperature data set. There are 4 observations per day for two
492
493
years which makes for 2920 values along the time dimension.
@@ -572,8 +573,9 @@ Faceted plotting supports other arguments common to xarray 2d plots.
572
573
FacetGrid Objects
573
574
===================
574
575
575
-
:py:class:`xarray.plot.FacetGrid` is used to control the behavior of the
576
-
multiple plots.
576
+
The object returned, ``g`` in the above examples, is a :py:class:`~xarray.plot.FacetGrid`` object
577
+
that links a :py:class:`DataArray` to a matplotlib figure with a particular structure.
578
+
This object can be used to control the behavior of the multiple plots.
577
579
It borrows an API and code from `Seaborn's FacetGrid
The structure is contained within the ``axes`` and ``name_dicts``
@@ -609,6 +611,13 @@ they have been plotted.
609
611
@savefigplot_facet_iterator.png
610
612
plt.draw()
611
613
614
+
615
+
:py:class:`~xarray.FacetGrid` objects have methods that let you customize the automatically generated
616
+
axis labels, axis ticks and plot titles. See :py:meth:`~xarray.plot.FacetGrid.set_titles`,
617
+
:py:meth:`~xarray.plot.FacetGrid.set_xlabels`, :py:meth:`~xarray.plot.FacetGrid.set_ylabels` and
618
+
:py:meth:`~xarray.plot.FacetGrid.set_ticks` for more information.
619
+
Plotting functions can be applied to each subset of the data by calling :py:meth:`~xarray.plot.FacetGrid.map_dataarray` or to each subplot by calling :py:meth:`FacetGrid.map`.
620
+
612
621
TODO: add an example of using the ``map`` method to plot dataset variables
0 commit comments