|
16 | 16 | # coastlines of the world with a Mercator projection:
|
17 | 17 |
|
18 | 18 | fig = pygmt.Figure()
|
19 |
| -fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M10i") |
| 19 | +fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M25c") |
20 | 20 | fig.show()
|
21 | 21 |
|
22 | 22 | ########################################################################################
|
23 | 23 | # To add the default GMT frame to the plot, use ``frame="f"`` in
|
24 | 24 | # :meth:`pygmt.Figure.basemap` or any other plotting module:
|
25 | 25 |
|
26 | 26 | fig = pygmt.Figure()
|
27 |
| -fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M10i") |
| 27 | +fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M25c") |
28 | 28 | fig.basemap(frame="f")
|
29 | 29 | fig.show()
|
30 | 30 |
|
|
36 | 36 | # and automatically determines tick labels from the plot region.
|
37 | 37 |
|
38 | 38 | fig = pygmt.Figure()
|
39 |
| -fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M10i") |
| 39 | +fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M25c") |
40 | 40 | fig.basemap(frame="a")
|
41 | 41 | fig.show()
|
42 | 42 |
|
43 | 43 | ########################################################################################
|
44 | 44 | # Add automatic grid lines to the plot by adding a ``g`` to ``frame``:
|
45 | 45 |
|
46 | 46 | fig = pygmt.Figure()
|
47 |
| -fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M10i") |
| 47 | +fig.coast(shorelines="1/0.5p", region=[-180, 180, -60, 60], projection="M25c") |
48 | 48 | fig.basemap(frame="ag")
|
49 | 49 | fig.show()
|
| 50 | + |
| 51 | +######################################################################################## |
| 52 | +# Title |
| 53 | +# ----- |
| 54 | +# |
| 55 | +# The figure title can be set by passing **+t**\ *title* to the ``frame`` parameter of |
| 56 | +# :meth:`pygmt.Figure.basemap`. Passing multiple arguments to ``frame`` can be done by |
| 57 | +# using a list, as show in the example below. |
| 58 | + |
| 59 | +fig = pygmt.Figure() |
| 60 | +# region="IS" specifies Iceland using the ISO country code |
| 61 | +fig.coast(shorelines="1/0.5p", region="IS", projection="M25c") |
| 62 | +fig.basemap(frame=["a", "+tIceland"]) |
| 63 | +fig.show() |
| 64 | + |
| 65 | +######################################################################################## |
| 66 | +# To use a title with multiple words, the title must be placed inside another set of |
| 67 | +# quotation marks. To prevent the quotation marks from appearing in the figure title, |
| 68 | +# the frame argument can be passed in single quotation marks and the title can be |
| 69 | +# passed in double quotation marks. |
| 70 | + |
| 71 | +fig = pygmt.Figure() |
| 72 | +# region="TT" specifies Trinidad and Tobago |
| 73 | +fig.coast(shorelines="1/0.5p", region="TT", projection="M25c") |
| 74 | +fig.basemap(frame=["a", '+t"Trinidad and Tobago"']) |
| 75 | +fig.show() |
| 76 | + |
| 77 | +######################################################################################## |
| 78 | +# Axis labels |
| 79 | +# ----------- |
| 80 | +# |
| 81 | +# Axis labels can be set by passing **x+l**\ *label* (or starting with y if |
| 82 | +# labeling the y-axis) if to the ``frame`` parameter of :meth:`pygmt.Figure.basemap`. |
| 83 | +# Axis labels will be displayed on all primary axes, which the default is all sides of |
| 84 | +# the figure. To designate only some of the axes as primary, an argument that |
| 85 | +# capitlizes only the primary axes can be passed, which is ``"WSne"`` in the example |
| 86 | +# below. The letters correspond with west (left), south (bottom), north (top), and |
| 87 | +# east (right) sides of a figure. |
| 88 | +# |
| 89 | +# The example below used a Cartesian projection, as GMT does not allow axis labels to |
| 90 | +# be set for geographic maps. |
| 91 | + |
| 92 | +fig = pygmt.Figure() |
| 93 | +fig.basemap( |
| 94 | + region=[0, 10, 0, 20], |
| 95 | + projection="X10c/8c", |
| 96 | + frame=["WSne", "x+lx-axis", "y+ly-axis"], |
| 97 | +) |
| 98 | +fig.show() |
0 commit comments