|
3 | 3 | ================================================== |
4 | 4 |
|
5 | 5 | It can be visually appealing to "drape" a dataset over a topographic surface. This can |
6 | | -be accomplished using the ``drapegrid`` parameter of :meth:`pygmt.Figure.grdview`. |
| 6 | +be accomplished using the ``drape_grid`` parameter of :meth:`pygmt.Figure.grdview`. |
7 | 7 |
|
8 | 8 | This tutorial consists of two examples: |
9 | 9 |
|
|
41 | 41 | # The topographic surface is created based on the grid passed to the ``grid`` parameter |
42 | 42 | # of :meth:`pygmt.Figure.grdview`; here we use a grid of the Earth relief. To add a |
43 | 43 | # color-coding based on *another* grid we have to pass a second grid to the |
44 | | -# ``drapegrid`` parameter; here we use a grid of the crustal age. In this case the |
| 44 | +# ``drape_grid`` parameter; here we use a grid of the crustal age. In this case the |
45 | 45 | # colormap specified via the ``cmap`` parameter applies to the grid passed to |
46 | | -# ``drapegrid``, not to ``grid``. The azimuth and elevation of the 3-D plot are set via |
| 46 | +# ``drape_grid``, not to ``grid``. The azimuth and elevation of the 3-D plot are set via |
47 | 47 | # the ``perspective`` parameter. |
48 | 48 |
|
49 | 49 | fig = pygmt.Figure() |
|
56 | 56 | projection="M12c", # Mercator projection with a width of 12 centimeters |
57 | 57 | region=region_3d, |
58 | 58 | grid=grd_relief, # Use elevation grid for z values |
59 | | - drapegrid=grd_age, # Use crustal age grid for color-coding |
| 59 | + drape_grid=grd_age, # Use crustal age grid for color-coding |
60 | 60 | cmap=True, # Use colormap created for the crustal age |
61 | 61 | surftype="i", # Create an image plot |
62 | 62 | # Use an illumination from the azimuthal directions 0° (north) and 270° |
|
101 | 101 | url_to_image = "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/Flag_of_Europe.svg/1000px-Flag_of_Europe.svg.png" |
102 | 102 | with rasterio.open(url_to_image) as dataset: |
103 | 103 | data = dataset.read() |
104 | | - drapegrid = xr.DataArray(data, dims=("band", "y", "x")) |
| 104 | + drape_grid = xr.DataArray(data, dims=("band", "y", "x")) |
105 | 105 |
|
106 | 106 | # %% |
107 | 107 | # Again we create a 3-D plot with :meth:`pygmt.Figure.grdview` and pass an Earth relief |
108 | 108 | # grid to the ``grid`` parameter to create the topographic surface. But now we pass the |
109 | | -# PNG image which was loaded into an :class:`xarray.DataArray` to the ``drapgrid`` |
| 109 | +# PNG image which was loaded into an :class:`xarray.DataArray` to the ``drape_grid`` |
110 | 110 | # parameter. |
111 | 111 |
|
112 | 112 | fig = pygmt.Figure() |
|
120 | 120 | projection="M12c", # Mercator projection with a width of 12 centimeters |
121 | 121 | region=region_3d, |
122 | 122 | grid=grd_relief, # Use elevation grid for z values |
123 | | - drapegrid=drapegrid, # Drap image grid for the EU flag on top |
| 123 | + drape_grid=drape_grid, # Drape image grid for the EU flag on top |
124 | 124 | cmap=True, # Use colormap defined for the EU flag |
125 | 125 | surftype="i", # Create an image plot |
126 | 126 | # Use an illumination from the azimuthal directions 0° (north) and 270° (west) with |
|
0 commit comments