|
3 | 3 | ================== |
4 | 4 |
|
5 | 5 | The :meth:`pygmt.Figure.grdview()` method can plot 3-D surfaces with |
6 | | -``surftype="s"``. Here, we supply the data as an :class:`xarray.DataArray` with |
7 | | -the coordinate vectors ``x`` and ``y`` defined. Note that the ``perspective`` |
8 | | -parameter here controls the azimuth and elevation angle of the view. We provide |
9 | | -a list of two arguments to ``frame`` - the first argument specifies the |
10 | | -:math:`x`- and :math:`y`-axes frame attributes and the second argument, |
11 | | -prepended with ``"z"``, specifies the :math:`z`-axis frame attributes. |
12 | | -Specifying the same scale for the ``projection`` and ``zscale`` parameters |
13 | | -ensures equal axis scaling. The ``shading`` parameter specifies illumination; |
14 | | -here we choose an azimuth of 45° with ``shading="+a45"``. |
| 6 | +``surftype="surface"``. Here, we supply the data as an :class:`xarray.DataArray` with |
| 7 | +the coordinate vectors ``x`` and ``y`` defined. Note that the ``perspective`` parameter |
| 8 | +here controls the azimuth and elevation angle of the view. We provide a list of two |
| 9 | +arguments to ``frame`` - the first argument specifies the :math:`x`- and :math:`y`-axes |
| 10 | +frame attributes and the second argument, prepended with ``"z"``, specifies the |
| 11 | +:math:`z`-axis frame attributes. Specifying the same scale for the ``projection`` and |
| 12 | +``zscale`` parameters ensures equal axis scaling. The ``shading`` parameter specifies |
| 13 | +illumination; here we choose an azimuth of 45° with ``shading="+a45"``. |
15 | 14 | """ |
16 | 15 |
|
17 | 16 | # %% |
@@ -46,12 +45,11 @@ def ackley(x, y): |
46 | 45 | SCALE = 0.5 # in centimeters |
47 | 46 | fig.grdview( |
48 | 47 | data, |
49 | | - # Set annotations and gridlines in steps of five, and |
50 | | - # tick marks in steps of one |
| 48 | + # Set annotations and gridlines in steps of five, and tick marks in steps of one |
51 | 49 | frame=["a5f1g5", "za5f1g5"], |
52 | 50 | projection=f"x{SCALE}c", |
53 | 51 | zscale=f"{SCALE}c", |
54 | | - surftype="s", |
| 52 | + surftype="surface", |
55 | 53 | cmap="roma", |
56 | 54 | perspective=[135, 30], # Azimuth southeast (135°), at elevation 30° |
57 | 55 | shading="+a45", |
|
0 commit comments