diff --git a/examples/projections/azim/azim_equidistant.py b/examples/projections/azim/azim_equidistant.py old mode 100755 new mode 100644 index a86109e4af9..59329e681b8 --- a/examples/projections/azim/azim_equidistant.py +++ b/examples/projections/azim/azim_equidistant.py @@ -1,21 +1,21 @@ -""" -Azimuthal Equidistant -===================== - -The main advantage of this projection is that distances from the projection -center are displayed in correct proportions. Also directions measured from the -projection center are correct. It is very useful for a global view on locations -that lie within a certain distance or for comparing distances of different -locations relative to the projection center. - -``elon0/lat0[/horizon]/scale`` or ``Elon0/lat0[/horizon]/width`` - -``lon0/lat0`` specifies the projection center. The optional parameter -``horizon`` specifies the max distance to the projection center (i.e. the -visibile portion of the rest of the world map) in degrees <= 180° (default 180°). -""" -import pygmt - -fig = pygmt.Figure() -fig.coast(projection="E-100/40/4.5i", region="g", frame="g", land="gray") -fig.show() +""" +Azimuthal Equidistant +===================== + +The main advantage of this projection is that distances from the projection +center are displayed in correct proportions. Also directions measured from the +projection center are correct. It is very useful for a global view on locations +that lie within a certain distance or for comparing distances of different +locations relative to the projection center. + +``elon0/lat0[/horizon]/scale`` or ``Elon0/lat0[/horizon]/width`` + +``lon0/lat0`` specifies the projection center. The optional parameter +``horizon`` specifies the max distance to the projection center (i.e. the +visibile portion of the rest of the world map) in degrees <= 180° (default 180°). +""" +import pygmt + +fig = pygmt.Figure() +fig.coast(projection="E-100/40/4.5i", region="g", frame="g", land="gray") +fig.show() diff --git a/examples/projections/azim/azim_general_perspective.py b/examples/projections/azim/azim_general_perspective.py old mode 100755 new mode 100644 index 97a0a89632f..f6e35a87bd4 --- a/examples/projections/azim/azim_general_perspective.py +++ b/examples/projections/azim/azim_general_perspective.py @@ -1,33 +1,33 @@ -""" -General Perspective -=================== - -The general perspective projection imitates the view of the Earth from a finite -point in space. In a full view of the earth one third of its surface area can -be seen. - -``lon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale`` or ``width`` - -``lon0/lat0`` specifies the projection center, ``altitude`` the height -in km of the viewpoint above local sea level (If altitude is less than 10, -then it is the distance from the center of the earth to the viewpoint in earth -radii). With ``azimuth`` the direction (in degrees) in which you are looking is -specified, measured clockwise from north. ``tilt`` is given in degrees and is the -viewing angle relative to zenith. A tilt of 0° is looking straight down, 60° is -looking 30° above horizon. ``twist`` is the clockwise rotation of the image (in -degrees). ``Width`` and ``Height`` describe the viewport angle in degrees. - -The example shows the coast of northern europe viewed from 250 km above sea -level looking 30° from north at a tilt of 45°. The height and width of the -viewing angle is both 60°, which imitates viewing with naked eye. -""" -import pygmt - -fig = pygmt.Figure() -fig.coast( - projection="G4/52/250/30/45/0/60/60/5i", - region="g", - frame=["x10g10", "y5g5"], - land="gray", -) -fig.show() +""" +General Perspective +=================== + +The general perspective projection imitates the view of the Earth from a finite +point in space. In a full view of the earth one third of its surface area can +be seen. + +``lon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale`` or ``width`` + +``lon0/lat0`` specifies the projection center, ``altitude`` the height +in km of the viewpoint above local sea level (If altitude is less than 10, +then it is the distance from the center of the earth to the viewpoint in earth +radii). With ``azimuth`` the direction (in degrees) in which you are looking is +specified, measured clockwise from north. ``tilt`` is given in degrees and is the +viewing angle relative to zenith. A tilt of 0° is looking straight down, 60° is +looking 30° above horizon. ``twist`` is the clockwise rotation of the image (in +degrees). ``Width`` and ``Height`` describe the viewport angle in degrees. + +The example shows the coast of northern europe viewed from 250 km above sea +level looking 30° from north at a tilt of 45°. The height and width of the +viewing angle is both 60°, which imitates viewing with naked eye. +""" +import pygmt + +fig = pygmt.Figure() +fig.coast( + projection="G4/52/250/30/45/0/60/60/5i", + region="g", + frame=["x10g10", "y5g5"], + land="gray", +) +fig.show() diff --git a/examples/projections/azim/azim_general_stereographic.py b/examples/projections/azim/azim_general_stereographic.py old mode 100755 new mode 100644 index 5d874e8a126..f9979329701 --- a/examples/projections/azim/azim_general_stereographic.py +++ b/examples/projections/azim/azim_general_stereographic.py @@ -1,28 +1,28 @@ -""" -General Stereographic -===================== - -This map projection is a conformal, azimuthal projection. It is mainly used with -a projection center in one of the poles. Then meridians appear as straight lines -and cross latitudes at a right angle. Unlike the azimuthal equidistant projection, -the distances in this projection are not displayed in correct proportions. -It is often used as a hemisphere map like the Lambert Azimuthal Equal Area -projection. - -``slon0/lat0[/horizon]/scale`` or ``Slon0/lat0[/horizon]/width`` - -``lon0/lat0`` specifies the projection center, the optional ``horizon`` parameter -specifies the max distance from projection center (in degrees, < 180, default 90). - -This projection can be displayed: - -* With map boundaries coinciding with longitude and latitude: - ``region`` specified via ``xmin/xmax/ymin/ymax`` -* As a map with rectangular boundaries: ``region`` specified as lower left and - upper right corner ``xlleft/ylleft/xuright/yurightr``. Note the appended ``r``. -""" -import pygmt - -fig = pygmt.Figure() -fig.coast(region="4/14/52/57", projection="S0/90/4.5i", frame="ag", land="gray") -fig.show() +""" +General Stereographic +===================== + +This map projection is a conformal, azimuthal projection. It is mainly used with +a projection center in one of the poles. Then meridians appear as straight lines +and cross latitudes at a right angle. Unlike the azimuthal equidistant projection, +the distances in this projection are not displayed in correct proportions. +It is often used as a hemisphere map like the Lambert Azimuthal Equal Area +projection. + +``slon0/lat0[/horizon]/scale`` or ``Slon0/lat0[/horizon]/width`` + +``lon0/lat0`` specifies the projection center, the optional ``horizon`` parameter +specifies the max distance from projection center (in degrees, < 180, default 90). + +This projection can be displayed: + +* With map boundaries coinciding with longitude and latitude: + ``region`` specified via ``xmin/xmax/ymin/ymax`` +* As a map with rectangular boundaries: ``region`` specified as lower left and + upper right corner ``xlleft/ylleft/xuright/yurightr``. Note the appended ``r``. +""" +import pygmt + +fig = pygmt.Figure() +fig.coast(region="4/14/52/57", projection="S0/90/4.5i", frame="ag", land="gray") +fig.show() diff --git a/examples/projections/azim/azim_gnomonic.py b/examples/projections/azim/azim_gnomonic.py old mode 100755 new mode 100644 index 464d90ad5b5..200cdbe5a5f --- a/examples/projections/azim/azim_gnomonic.py +++ b/examples/projections/azim/azim_gnomonic.py @@ -1,22 +1,22 @@ -""" -Gnomonic -======== - -The point of perspective of the gnomonic projection lies at the center of the -earth. As a consequence great circles (orthodromes) on the surface of the earth -are displayed as straight lines, which makes it suitable for distance estimation -for navigational purposes. It is neither conformal nor equal-area and the -distortion increases greatly with distance to the projection center. It follows -that the scope of application is restricted to a small area around the -projection center (at a maximum of 60°). - -``flon0/lat0[/horizon]/scale`` or ``Flon0/lat0[/horizon]/width`` - -``lon0/lat0`` specify the projection center, the optional parameter ``horizon`` -specifies the max distance from projection center (in degrees, < 90, default 60). -""" -import pygmt - -fig = pygmt.Figure() -fig.coast(projection="F-90/15/4.5i", region="g", frame="20g20", land="gray") -fig.show() +""" +Gnomonic +======== + +The point of perspective of the gnomonic projection lies at the center of the +earth. As a consequence great circles (orthodromes) on the surface of the earth +are displayed as straight lines, which makes it suitable for distance estimation +for navigational purposes. It is neither conformal nor equal-area and the +distortion increases greatly with distance to the projection center. It follows +that the scope of application is restricted to a small area around the +projection center (at a maximum of 60°). + +``flon0/lat0[/horizon]/scale`` or ``Flon0/lat0[/horizon]/width`` + +``lon0/lat0`` specify the projection center, the optional parameter ``horizon`` +specifies the max distance from projection center (in degrees, < 90, default 60). +""" +import pygmt + +fig = pygmt.Figure() +fig.coast(projection="F-90/15/4.5i", region="g", frame="20g20", land="gray") +fig.show() diff --git a/examples/projections/azim/azim_orthographic.py b/examples/projections/azim/azim_orthographic.py old mode 100755 new mode 100644 index a7c3a43eedc..5044f6278aa --- a/examples/projections/azim/azim_orthographic.py +++ b/examples/projections/azim/azim_orthographic.py @@ -1,20 +1,20 @@ -""" -Orthographic -============ - -This is a perspective projection like the general perspective, -but with the difference that the point of perspective lies in infinite distance. -It is therefore often used to give the appearance of a globe viewed from outer -space, were one hemisphere can be seen as a whole. It is neither conformal nor -equal-area and the distortion increases near the edges. - -``glon0/lat0[/horizon]/scale`` or ``Glon0/lat0[/horizon]/width`` - -``lon0/lat0`` specifies the projection center, the optional parameter ``horizon`` -specifies the max distance from projection center (in degrees, <= 90, default 90) -""" -import pygmt - -fig = pygmt.Figure() -fig.coast(projection="G10/52/4.5i", region="g", frame="g", land="gray") -fig.show() +""" +Orthographic +============ + +This is a perspective projection like the general perspective, +but with the difference that the point of perspective lies in infinite distance. +It is therefore often used to give the appearance of a globe viewed from outer +space, were one hemisphere can be seen as a whole. It is neither conformal nor +equal-area and the distortion increases near the edges. + +``glon0/lat0[/horizon]/scale`` or ``Glon0/lat0[/horizon]/width`` + +``lon0/lat0`` specifies the projection center, the optional parameter ``horizon`` +specifies the max distance from projection center (in degrees, <= 90, default 90) +""" +import pygmt + +fig = pygmt.Figure() +fig.coast(projection="G10/52/4.5i", region="g", frame="g", land="gray") +fig.show() diff --git a/examples/projections/nongeo/cartesian.py b/examples/projections/nongeo/cartesian.py old mode 100755 new mode 100644 index c753cae2a60..9da8d2ebd81 --- a/examples/projections/nongeo/cartesian.py +++ b/examples/projections/nongeo/cartesian.py @@ -1,21 +1,21 @@ -""" -Cartesian -========= - -``Xwidth/[height]``: Give the ``width`` of the figure and the optional argument ``height``. -""" -import pygmt - -fig = pygmt.Figure() -fig.plot( - # The ``x`` and ``y`` parameters are used to plot lines on the figure. - x=[3, 9, 2], - y=[4, 9, 37], - pen="3p,red", - # ``region`` sets the x and y ranges or the Cartesian figure. - region=[0, 10, 0, 50], - # The argument ``WSne`` is passed to ``frame`` to put axis labels only on the left and bottom axes. - projection="X15c/10c", - frame=["af", "WSne"], -) -fig.show() +""" +Cartesian +========= + +``Xwidth/[height]``: Give the ``width`` of the figure and the optional argument ``height``. +""" +import pygmt + +fig = pygmt.Figure() +fig.plot( + # The ``x`` and ``y`` parameters are used to plot lines on the figure. + x=[3, 9, 2], + y=[4, 9, 37], + pen="3p,red", + # ``region`` sets the x and y ranges or the Cartesian figure. + region=[0, 10, 0, 50], + # The argument ``WSne`` is passed to ``frame`` to put axis labels only on the left and bottom axes. + projection="X15c/10c", + frame=["af", "WSne"], +) +fig.show()