@@ -35,12 +35,11 @@ def grdview(self, grid, **kwargs):
35
35
r"""
36
36
Create 3-D perspective image or surface mesh from a grid.
37
37
38
- Reads a 2-D grid file and produces a 3-D perspective plot by drawing a
39
- mesh, painting a colored/gray-shaded surface made up of polygons, or by
40
- scanline conversion of these polygons to a raster image. Options
41
- include draping a data set on top of a surface, plotting of contours on
42
- top of the surface, and apply artificial illumination based on
43
- intensities provided in a separate grid file.
38
+ Reads a 2-D grid file and produces a 3-D perspective plot by drawing a mesh,
39
+ painting a colored/gray-shaded surface made up of polygons, or by scanline
40
+ conversion of these polygons to a raster image. Options include draping a data
41
+ set on top of a surface, plotting of contours on top of the surface, and apply
42
+ artificial illumination based on intensities provided in a separate grid file.
44
43
45
44
Full option list at :gmt-docs:`grdview.html`
46
45
@@ -51,58 +50,55 @@ def grdview(self, grid, **kwargs):
51
50
{grid}
52
51
region : str or list
53
52
*xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*].
54
- Specify the :doc:`region </tutorials/basics/regions>` of interest.
55
- When used with ``perspective``, optionally append */zmin/zmax* to
56
- indicate the range to use for the 3-D axes [Default is the region in
57
- the input grid].
53
+ Specify the :doc:`region </tutorials/basics/regions>` of interest. When used
54
+ with ``perspective``, optionally append */zmin/zmax* to indicate the range to
55
+ use for the 3-D axes [Default is the region given by the input grid].
58
56
{projection}
59
57
zscale/zsize : float or str
60
58
Set z-axis scaling or z-axis size.
61
59
{frame}
62
60
cmap : str
63
61
The name of the color palette table to use.
64
62
drapegrid : str or :class:`xarray.DataArray`
65
- The file name or a DataArray of the image grid to be draped on top
66
- of the relief provided by ``grid`` [Default determines colors from grid].
67
- Note that ``zscale`` and ``plane`` always refer to the grid.
68
- The drapegrid only provides the information pertaining to colors, which
69
- (if drapegrid is a grid) will be looked-up via the CPT (see ``cmap``).
63
+ The file name or a :class:`xarray. DataArray` of the image grid to be draped on
64
+ top of the relief provided by ``grid`` [Default determines colors from `` grid``]
65
+ Note that ``zscale`` and ``plane`` always refer to `` grid``. ``drapegrid`` only
66
+ provides the information pertaining to colors, which (if ``drapegrid`` is a
67
+ grid) will be looked-up via the CPT (see ``cmap``).
70
68
plane : float or str
71
69
*level*\ [**+g**\ *fill*].
72
- Draw a plane at this z-level. If the optional color is provided
73
- via the **+g** modifier, and the projection is not oblique, the frontal
74
- facade between the plane and the data perimeter is colored.
70
+ Draw a plane at this z-level. If the optional color is provided via the **+g**
71
+ modifier, and the projection is not oblique, the frontal facade between the
72
+ plane and the data perimeter is colored.
75
73
surftype : str
76
- Specify cover type of the grid.
77
- Select one of following settings:
74
+ Specify cover type of the grid. Select one of following settings:
78
75
79
76
- **m**: mesh plot [Default].
80
77
- **mx** or **my**: waterfall plots (row or column profiles).
81
- - **s**: surface plot, and optionally append **m** to have mesh lines
82
- drawn on top of the surface.
78
+ - **s**: surface plot, and optionally append **m** to have mesh lines drawn on
79
+ top of the surface.
83
80
- **i**: image plot.
84
81
- **c**: Same as **i** but will make nodes with z = NaN transparent.
85
82
86
- For any of these choices, you may force a monochrome image by
87
- appending the modifier **+m**.
83
+ For any of these choices, you may force a monochrome image by appending the
84
+ modifier **+m**.
88
85
contourpen : str
89
- Draw contour lines on top of surface or mesh (not image). Append
90
- pen attributes used for the contours.
86
+ Draw contour lines on top of surface or mesh (not image). Append pen attributes
87
+ used for the contours.
91
88
meshpen : str
92
- Set the pen attributes used for the mesh. You must also select
93
- ``surftype`` of **m** or **sm** for meshlines to be drawn.
89
+ Set the pen attributes used for the mesh. You must also select ``surftype`` of
90
+ **m** or **sm** for meshlines to be drawn.
94
91
facadepen :str
95
- Set the pen attributes used for the facade. You must also select
96
- ``plane`` for the facade outline to be drawn.
92
+ Set the pen attributes used for the facade. You must also select ``plane`` for
93
+ the facade outline to be drawn.
97
94
shading : str
98
- Provide the name of a grid file with intensities in the (-1,+1)
99
- range, or a constant intensity to apply everywhere (affects the
100
- ambient light). Alternatively, derive an intensity grid from the
101
- input data grid reliefgrid via a call to :func:`pygmt.grdgradient`;
102
- append **+a**\ *azimuth*, **+n**\ *args*, and **+m**\ *ambient* to
103
- specify azimuth, intensity, and ambient arguments for that function,
104
- or just give **+d** to select the default arguments
105
- [Default is **+a**\ -45\ **+nt**\ 1\ **+m**\ 0].
95
+ Provide the name of a grid file with intensities in the (-1,+1) range, or a
96
+ constant intensity to apply everywhere (affects the ambient light).
97
+ Alternatively, derive an intensity grid from the main input data grid by using
98
+ :func:`pygmt.grdgradient` first; append **+a**\ *azimuth*, **+n**\ *args*, and
99
+ **+m**\ *ambient* to specify azimuth, intensity, and ambient arguments for that
100
+ function, or just give **+d** to select the default arguments [Default is
101
+ "+a-45+nt1+m0"].
106
102
{verbose}
107
103
{panel}
108
104
{coltypes}
@@ -113,34 +109,33 @@ def grdview(self, grid, **kwargs):
113
109
Example
114
110
-------
115
111
>>> import pygmt
116
- >>> # load the 30 arc-minutes grid with "gridline" registration
117
- >>> # in a specified region
112
+ >>> # Load the 30 arc-minutes grid with "gridline" registration in a given region
118
113
>>> grid = pygmt.datasets.load_earth_relief(
119
114
... resolution="30m",
120
115
... region=[-92.5, -82.5, -3, 7],
121
116
... registration="gridline",
122
117
... )
123
- >>> # create a new figure instance with pygmt.Figure()
118
+ >>> # Create a new figure instance with pygmt.Figure()
124
119
>>> fig = pygmt.Figure()
125
- >>> # create the contour plot
120
+ >>> # Create the contour plot
126
121
>>> fig.grdview(
127
- ... # pass in the grid downloaded above
122
+ ... # Pass in the grid downloaded above
128
123
... grid=grid,
129
- ... # set the perspective to an azimuth of 130° and an elevation of 30°
124
+ ... # Set the perspective to an azimuth of 130° and an elevation of 30°
130
125
... perspective=[130, 30],
131
- ... # add a frame to the x- and y-axes
132
- ... # specify annotations on the south and east borders of the plot
126
+ ... # Add a frame to the x- and y-axes
127
+ ... # Specify annotations on the south and east borders of the plot
133
128
... frame=["xa", "ya", "wSnE"],
134
- ... # set the projection of the 2-D map to Mercator with a 10 cm width
129
+ ... # Set the projection of the 2-D map to Mercator with a 10 cm width
135
130
... projection="M10c",
136
- ... # set the vertical scale (z-axis) to 2 cm
131
+ ... # Set the vertical scale (z-axis) to 2 cm
137
132
... zsize="2c",
138
- ... # set "surface plot" to color the surface via a CPT
133
+ ... # Set "surface plot" to color the surface via a CPT
139
134
... surftype="s",
140
- ... # specify CPT to "geo"
135
+ ... # Specify CPT to "geo"
141
136
... cmap="geo",
142
137
... )
143
- >>> # show the plot
138
+ >>> # Show the plot
144
139
>>> fig.show()
145
140
"""
146
141
kwargs = self ._preprocess (** kwargs )
0 commit comments