Skip to content

Commit 8af19ac

Browse files
committed
DOC: review comment [ci doc]
1 parent ee9b46d commit 8af19ac

File tree

4 files changed

+31
-27
lines changed

4 files changed

+31
-27
lines changed

galleries/users_explain/plotting/gridded.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""
22
.. _plot_gridded:
33
4-
Gridded plots
5-
=============
4+
Gridded data
5+
============
66
77
This section discusses data that mapped onto a two-dimensional grid. The data
88
usually has structured coordinates defined by arrays of x and y values, and data

galleries/users_explain/plotting/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
++++++++++++++++
2-
Plotting methods
3-
++++++++++++++++
1+
+++++++++++++
2+
Plotting data
3+
+++++++++++++
44

55
.. _users-guide-plotting:
66

galleries/users_explain/plotting/threed.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
Matplotlib has support for three-dimensional plots, including surface plots,
88
wireframes, and 3D scatter plots.
99
10-
Note, however, that Matplotlib does not do proper ray-tracing, and hence
11-
multiple surfaces in one visualization will not occlude one another correctly;
12-
the last surface drawn will cover previous surfaces, regardless of their
13-
distance from the viewer. Either try to combine surfaces into one (which is
14-
possible for simple plots, see :ref:`intersecting_planes` and :ref:`box3d`), or
15-
for true 3D, consider using `Mayavi
10+
Note, however, that Matplotlib does not do true 3D rendering with depth
11+
buffering, and hence multiple surfaces in one visualization will not occlude
12+
one another correctly; the last surface drawn will cover previous surfaces,
13+
regardless of their distance from the viewer. Either try to combine surfaces
14+
into one (which is possible for simple plots, see :ref:`intersecting_planes`
15+
and :ref:`box3d`), or for true 3D, consider using `Mayavi
1616
<https://docs.enthought.com/mayavi/mayavi/>`_.
1717
1818
Plotting in 3D can be done using the `.mpl_toolkits.mplot3d` toolkit by

galleries/users_explain/plotting/unstructuredgrid.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,25 @@
44
Unstructured data
55
=================
66
7-
Unlike :ref:`structured grids <plot_gridded>`, three-dimensional data is often
8-
collected without the benefit of a grid, with :math:`z = f(x, y)` where
9-
:math:`x` and :math:`y` are one-dimensional arrays of the same length, and
10-
hence :math:`z` is also one-dimensional. Sometimes it is useful to grid that
11-
data via appropriate interpolation schemes (see `scipy.interpolate.griddata`
12-
for some in python). However, if the data is spaced appropriately, it can sometimes
13-
be plotted directly in Matplotlib.
14-
15-
Matplotlib accomplishes this via a suite of triangulation routines in the
16-
:mod:`matplotlib.tri` module. The most basic triangulation routine is
17-
`~matplotlib.tri.Triangulation`, which is a simple wrapper around the popular
18-
`Qhull <http://www.qhull.org/>`_ library. The `~matplotlib.tri.Triangulation`
19-
class is used to create a triangulation of a set of points, and this
20-
triangulation can then be used to create either faceted psuedocolor plots, or
21-
contour plots.
7+
Unlike :ref:`structured grids <plot_gridded>`, unstructured data are not
8+
sampled on a regular grid. In this case, :math:`x` and :math:`y` are
9+
one-dimensional arrays of the same length, and :math:`z = f(x, y)` is also
10+
one-dimensional. For example, consider a temperature field
11+
:math:`T(\\text{longitude}, \\text{latitude})` measured at 120 weather stations,
12+
with each station at a different latitude and longitude.
13+
14+
You can interpolate this kind of data onto a regular grid (for example with
15+
`scipy.interpolate.griddata`), but if the sampling is suitable it can often be
16+
plotted directly in Matplotlib.
17+
18+
Matplotlib supports this through triangulation routines in
19+
:mod:`matplotlib.tri`. The `Qhull <http://www.qhull.org/>`_ library is used to
20+
build a triangulation from the input points via
21+
`~matplotlib.tri.Triangulation`, which can then be used for faceted
22+
pseudocolor and contour plots.
23+
24+
The triangulation treats the points :math:`(x, y)` as unordered, connecting
25+
points based on proximity.
2226
2327
"""
2428

@@ -87,7 +91,7 @@ class is used to create a triangulation of a set of points, and this
8791
# --------------------------
8892
#
8993
# The `~.axes.Axes.tricontour` and `~.axes.Axes.tricontourf` methods can be
90-
# used to plot contours of unstractured data, where the underlying
94+
# used to plot contours of unstructured data, where the underlying
9195
# triangulation is used to interpolate the contour locations. Here we plot
9296
# contours of the same data as above.
9397

0 commit comments

Comments
 (0)