Skip to content

Improve the documentation of Figure.shift_origin() #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions pygmt/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def shift_origin(self, xshift=None, yshift=None):
Shift plot origin in x and/or y directions.

This method shifts plot origin relative to the current origin by
(*xshift*,*yshift*) and optionally append the length unit (**c**,
(*xshift*, *yshift*) and optionally append the length unit (**c**,
**i**, or **p**).

Prepend **a** to shift the origin back to the original position after
Expand All @@ -308,14 +308,22 @@ def shift_origin(self, xshift=None, yshift=None):
move the origin relative to its current location.

Detailed usage at
:gmt-docs:`GMT_Docs.html#plot-positioning-and-layout-the-x-y-options`
:gmt-docs:`cookbook/options.html#plot-positioning-and-layout-the-x-y-options`

Parameters
----------
xshift : str
Shift plot origin in x direction.
yshift : str
Shift plot origin in y direction.

Notes
-----
For GMT 6.1.0, this function can't be used as the first plotting
function of :meth:`pygmt.Figure`, since it relies the *region* and
*projection* settings from previous commands.

.. TODO: Remove the notes when PyGMT bumps to GMT>=6.1.1.
"""
self._preprocess()
args = ["-T"]
Expand Down