|
12 | 12 | # In Cartesian coordinate systems lines are plotted as straight lines. |
13 | 13 |
|
14 | 14 | import pygmt |
15 | | -from pygmt.params import Box, Position |
| 15 | +from pygmt.params import Axis, Box, Frame, Position |
16 | 16 |
|
17 | 17 | fig = pygmt.Figure() |
18 | 18 |
|
19 | 19 | fig.basemap( |
20 | | - region=[0, 10, 0, 10], projection="X10c/10c", frame=["+tCartesian hlines", "af"] |
| 20 | + region=[0, 10, 0, 10], |
| 21 | + projection="X10c/10c", |
| 22 | + frame=Frame(title="Cartesian hlines", axis=Axis(annot=True, tick=True)), |
21 | 23 | ) |
22 | 24 |
|
23 | 25 | # Add a horizontal line at y=9 |
|
37 | 39 | fig.shift_origin(xshift="w+2c") |
38 | 40 |
|
39 | 41 | fig.basemap( |
40 | | - region=[0, 10, 0, 10], projection="X10c/10c", frame=["+tCartesian vlines", "af"] |
| 42 | + region=[0, 10, 0, 10], |
| 43 | + projection="X10c/10c", |
| 44 | + frame=Frame(title="Cartesian vlines", axis=Axis(annot=True, tick=True)), |
41 | 45 | ) |
42 | 46 | # Add a vertical line at x=1 |
43 | 47 | fig.vlines(x=1, pen="1.5p,red3", label="Line 1") |
|
64 | 68 |
|
65 | 69 | fig = pygmt.Figure() |
66 | 70 |
|
67 | | -fig.basemap(region="g", projection="R15c", frame=["+tGeographic hlines", "af"]) |
| 71 | +fig.basemap( |
| 72 | + region="g", |
| 73 | + projection="R15c", |
| 74 | + frame=Frame(title="Geographic hlines", axis=Axis(annot=True, tick=True)), |
| 75 | +) |
68 | 76 | # Add a line at 70°N |
69 | 77 | fig.hlines(y=70, pen="1.5p,red3", label="Line 1") |
70 | 78 | # Add a line at 50°N with longitude limits at 20°E and 160°E |
|
75 | 83 |
|
76 | 84 | fig.shift_origin(xshift="w+2c") |
77 | 85 |
|
78 | | -fig.basemap(region="g", projection="R15c", frame=["+tGeographic vlines", "af"]) |
| 86 | +fig.basemap( |
| 87 | + region="g", |
| 88 | + projection="R15c", |
| 89 | + frame=Frame(title="Geographic vlines", axis=Axis(annot=True, tick=True)), |
| 90 | +) |
79 | 91 | # Add a line at 70°E |
80 | 92 | fig.vlines(x=70, pen="1.5p,red3", label="Line 1") |
81 | 93 | # Add a line at 20°E with latitude limits at 50°S and 70°N |
|
95 | 107 |
|
96 | 108 | fig = pygmt.Figure() |
97 | 109 |
|
98 | | -fig.basemap(region=[0, 360, 0, 1], projection="P10c", frame=["+tPolar hlines", "af"]) |
| 110 | +fig.basemap( |
| 111 | + region=[0, 360, 0, 1], |
| 112 | + projection="P10c", |
| 113 | + frame=Frame(title="Polar hlines", axis=Axis(annot=True, tick=True)), |
| 114 | +) |
99 | 115 | # Add a line along radius=0.8 |
100 | 116 | fig.hlines(y=0.8, pen="1.5p,red3", label="Line 1") |
101 | 117 | # Add a line along radius=0.5 with azimuth limits at 30° and 160° |
|
106 | 122 |
|
107 | 123 | fig.shift_origin(xshift="w+2c") |
108 | 124 |
|
109 | | -fig.basemap(region=[0, 360, 0, 1], projection="P10c", frame=["+tPolar vlines", "af"]) |
| 125 | +fig.basemap( |
| 126 | + region=[0, 360, 0, 1], |
| 127 | + projection="P10c", |
| 128 | + frame=Frame(title="Polar vlines", axis=Axis(annot=True, tick=True)), |
| 129 | +) |
110 | 130 | # Add a line along azimuth=120° |
111 | 131 | fig.vlines(x=120, pen="1.5p,red3", label="Line 1") |
112 | 132 | # Add a line along azimuth=190° with radius limits at 0.2 and 0.8 |
|
0 commit comments