pygmt.params.Perspective

class pygmt.params.Perspective(azimuth, elevation=None, zlevel=None, plane=None, center=None, viewpoint=None)[source]

Class for setting perspective view.

Examples

>>> import pygmt
>>> from pygmt.params import Perspective
>>> fig = pygmt.Figure()
>>> fig.basemap(
...     region=[0, 10, 0, 10, 0, 20],
...     projection="X3c",
...     zsize="3c",
...     frame=["xafg", "yafg", "zafg", "wSEnZ"],
...     perspective=Perspective(azimuth=135, elevation=40, zlevel=10),
... )
>>> fig.show()
azimuth: float

Azimuth of the viewpoint in degress. Default is 180.0 (looking from south to north).

elevation: float | None = None

Elevation angle of the viewpoint in degrees. Default is 90.0 (looking from directly above).

zlevel: float | None = None

The z-level at which all 2-D material, like the plot frame, is plotted (only valid when used in consort with parameters zsize/zscale. Default is at the bottom of the z-axis].

plane: Optional[Literal['x', 'y', 'z']] = None

The plane to plot against the “wall” x = level (using x) or y = level (using y) or the horizontal plain (using z). Default is the z-plane.

center: Sequence[float] | None = None

For frames used for animation, the center of the data domain is fixed. Specify another center using either parameters center or viewpoint.

Project the coordinate (lon0, lat0) or (lon0, lat0, z0) to the center of the page size.

viewpoint: Sequence[float] | None = None

Specify the coordinates (x0, y0) of the projected 2-D view point.