The **-X** **-Y** options
^^^^^^^^^^^^^^^^^^^^^^^^^

**Syntax**

.. _-X:

**-X**\ [**a**\|\ **c**\|\ **f**\|\ **r**][*xshift*]
    Shift plot origin. |Add_-XY|

.. _-Y:

**-Y**\ [**a**\|\ **c**\|\ **f**\|\ **r**][*yshift*]
    Shift plot origin. |Add_-XY|

**Description**

The **-X** and **-Y** options shift the plot origin relative to the current origin by (*xshift*,\ *yshift*). Optionally,
append the length unit (**c**, **i**, or **p**). Default is (:term:`MAP_ORIGIN_X`, :term:`MAP_ORIGIN_Y`) for new
plots, which ensures that boundary annotations fit on the page. Subsequent overlays will be co-registered with the
previous plot unless the origin is shifted using these options. The following directives are supported
[default is **r**]:

- **a** - Prepend to shift the origin back to the original position after plotting.
- **c** - Prepend to center the plot on the center of the paper (optionally add a *shift*) (classic mode only).
- **f** - Prepend to shift the origin relative to the fixed lower left (classic mode only).
- **r** - Prepend to move the origin relative to its current location.

**Note**: Directives **c** and **f** are only available in classic mode.
When **-X** or **-Y** are used without any further arguments, the values from the last use of that option in a previous
GMT command will be used. In modern mode, **-X** and **-Y** can also access the previous plot bounding box dimensions *w* and
*h* and construct offsets that involve them.  Thus, *xshift* can in general be [[±][*f*]\ *w*\ [/\ *d*\ ]±]\ *xoff*, where optional signs, factor *f*
and divisor *d* can be used to compute an offset that may be adjusted further by ±\ *off*.  Similarly, *yshift* can in general be
[[±][*f*]\ *h*\ [/\ *d*\ ]±]\ *yoff*.  For instance, to move the origin up 2 cm beyond the height of the previous plot, use **-Y**\ *h*\ +2c.
To move the origin half the width to the right, use **-X**\ *w*\ /2. **Note**: the previous plot bounding box refers to the last
object plotted, which may be an image, logo, legend, colorbar, etc.
