|
100 | 100 | nrows=2, |
101 | 101 | ncols=2, |
102 | 102 | figsize=("15c", "6c"), |
103 | | - autolabel=True, |
| 103 | + auto_label=True, |
104 | 104 | frame=["af", "WSne"], |
105 | 105 | margins=["0.1c", "0.2c"], |
106 | 106 | title="My Subplot Heading", |
|
117 | 117 | # 15 cm wide and 6 cm high (``figsize=["15c", "6c"]``). In addition, we use |
118 | 118 | # some optional parameters to fine-tune some details of the figure creation: |
119 | 119 | # |
120 | | -# - ``autolabel=True``: Each subplot is automatically labelled 'abcd'. |
| 120 | +# - ``auto_label=True``: Each subplot is automatically labelled 'abcd'. |
121 | 121 | # - ``margins=["0.1c", "0.2c"]``: Adjusts the space between adjacent subplots. |
122 | 122 | # In this case, it is set as 0.1 cm in the x-direction and 0.2 cm in the |
123 | 123 | # y-direction. |
|
168 | 168 | nrows=2, |
169 | 169 | ncols=2, |
170 | 170 | figsize=("15c", "6c"), # width of 15 cm, height of 6 cm |
171 | | - autolabel=True, |
| 171 | + auto_label=True, |
172 | 172 | margins=["0.3c", "0.2c"], # horizontal 0.3 cm and vertical 0.2 cm margins |
173 | 173 | title="My Subplot Heading", |
174 | 174 | sharex="b", # shared x-axis on the bottom side |
|
204 | 204 |
|
205 | 205 | fig = pygmt.Figure() |
206 | 206 | # Bottom row, two subplots |
207 | | -with fig.subplot(nrows=1, ncols=2, figsize=("15c", "3c"), autolabel="b)"): |
| 207 | +with fig.subplot(nrows=1, ncols=2, figsize=("15c", "3c"), auto_label="b)"): |
208 | 208 | fig.basemap( |
209 | 209 | region=[0, 5, 0, 5], projection="X?", frame=["af", "WSne"], panel=[0, 0] |
210 | 210 | ) |
|
214 | 214 | # Move plot origin by 1 cm above the height of the entire figure |
215 | 215 | fig.shift_origin(yshift="h+1c") |
216 | 216 | # Top row, one subplot |
217 | | -with fig.subplot(nrows=1, ncols=1, figsize=("15c", "3c"), autolabel="a)"): |
| 217 | +with fig.subplot(nrows=1, ncols=1, figsize=("15c", "3c"), auto_label="a)"): |
218 | 218 | fig.basemap( |
219 | 219 | region=[0, 10, 0, 10], projection="X?", frame=["af", "WSne"], panel=[0, 0] |
220 | 220 | ) |
|
223 | 223 | fig.show() |
224 | 224 |
|
225 | 225 | # %% |
226 | | -# We start by drawing the bottom two subplots, setting ``autolabel="b)"`` so |
| 226 | +# We start by drawing the bottom two subplots, setting ``auto_label="b)"`` so |
227 | 227 | # that the subplots are labelled 'b)' and 'c)'. Next, we use |
228 | 228 | # :meth:`pygmt.Figure.shift_origin` to move the plot origin 1 cm above the |
229 | 229 | # **h**\ eight of the entire figure that is currently plotted (i.e. the bottom |
230 | 230 | # row subplots). A single subplot is then plotted on the top row. You may need |
231 | 231 | # to adjust the ``yshift`` parameter to make your plot look nice. This top row |
232 | | -# uses ``autolabel="a)"``, and we also plotted some text inside. Note that |
| 232 | +# uses ``auto_label="a)"``, and we also plotted some text inside. Note that |
233 | 233 | # ``projection="X?"`` was used to let GMT automatically determine the size of |
234 | 234 | # the subplot according to the size of the subplot area. |
235 | 235 |
|
236 | 236 | # %% |
237 | | -# You can also manually override the ``autolabel`` for each subplot using for |
238 | | -# example, ``fig.set_panel(..., fixedlabel="b) Panel 2")`` which would allow |
| 237 | +# You can also manually override the ``auto_label`` for each subplot using for |
| 238 | +# example, ``fig.set_panel(..., fixed_label="b) Panel 2")`` which would allow |
239 | 239 | # you to manually label a single subplot as you wish. This can be useful for |
240 | 240 | # adding a more descriptive subtitle to individual subplots. |
241 | 241 |
|
|
0 commit comments