Skip to content

Commit 558789c

Browse files
Figure.shift_origin: Improve docstrings to clarify the meaning of w/h (#4247)
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
1 parent 67a6805 commit 558789c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pygmt/src/shift_origin.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ def shift_origin(
3838
to other units via :gmt-term:`PROJ_LENGTH_UNIT`. Optionally, append the length unit
3939
(**c** for centimeters, **i** for inches, or **p** for points) to the shifts.
4040
41-
For *xshift*, a special character **w** can also be used, which represents the
42-
bounding box **width** of the previous plot. The full syntax is
43-
[[±][*f*]\ **w**\ [/\ *d*\ ]±]\ *xoff*, where optional signs, factor *f* and divisor
44-
*d* can be used to compute an offset that may be adjusted further by ±\ *xoff*.
45-
Assuming that the previous plot has a width of 10 centimeters, here are some example
41+
For *xshift*, character **w** can be used, which represents the bounding box
42+
**width** of the last plotting object. The full syntax is
43+
[[±][*f*]\ **w**\ [/*d*]±]\ *xoff*, where optional signs, factor *f* and divisor *d*
44+
can be used to compute an offset that may be adjusted further by ±\ *xoff*. Assuming
45+
that the last plotting object has a width of 10 centimeters, here are some example
4646
values for *xshift*:
4747
4848
- ``"w"``: x-shift is 10 cm
4949
- ``"w+2c"``: x-shift is 10+2=12 cm
5050
- ``"2w+3c"``: x-shift is 2*10+3=23 cm
5151
- ``"w/2-2c"``: x-shift is 10/2-2=3 cm
5252
53-
Similarly, for *yshift*, a special character **h** can also be used, which is the
54-
bounding box **height** of the previous plot.
53+
Similarly, for *yshift*, character **h** can be used, which is the bounding box
54+
**height** of the last plotting object.
5555
56-
**Note**: The previous plot bounding box refers to the last object plotted, which
57-
may be a basemap, image, logo, legend, colorbar, etc.
56+
**Note**: The last plotting object can be a basemap, image, logo, legend, colorbar,
57+
etc.
5858
5959
Parameters
6060
----------

0 commit comments

Comments
 (0)