Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8e11383
Improve installation doc
core-man Mar 3, 2021
54d9504
Add a note for test time
core-man Mar 3, 2021
75e2d4f
Improve first figure documentation
core-man Mar 3, 2021
acb3d55
Apply suggestions from code review
core-man Mar 3, 2021
28ffae6
Merge branch 'master' into imporve-doc
core-man Mar 4, 2021
516e822
Apply suggestions from code review
core-man Mar 4, 2021
5f67156
Fix SI unit
core-man Mar 4, 2021
2c730e5
Add how to update dev version
core-man Mar 4, 2021
4ddf0c1
Update note for experienced GMT users
core-man Mar 4, 2021
a696e7b
Fix typo
core-man Mar 4, 2021
99a9215
Fix typo
core-man Mar 4, 2021
4bc4041
Update quickstart note
core-man Mar 4, 2021
0f2cb2c
Apply suggestions from code review
core-man Mar 4, 2021
90bf31f
Merge branch 'master' into imporve-doc
core-man Mar 4, 2021
3d8c883
Tiny improve for the colorbar gallery
core-man Mar 5, 2021
688ee7a
Add the link for GMT color names
core-man Mar 5, 2021
8810a7b
Merge branch 'master' into imporve-doc
core-man Mar 5, 2021
2b4b971
Tiny improve for the track_sampling gallery
core-man Mar 5, 2021
f9be2b5
Tiny improve for the line-custom-cpt gallery
core-man Mar 5, 2021
bef3416
Tiny improve for the linestyles gallery
core-man Mar 5, 2021
5cae452
Tiny improve for the inset gallery
core-man Mar 5, 2021
1750fd3
Tiny improve for the image gallery
core-man Mar 5, 2021
e2b467e
Tiny improve for the multi-parameter symbols gallery
core-man Mar 5, 2021
b9b36b3
Tiny improve for the points-transparency gallery
core-man Mar 5, 2021
0ab9fef
Tiny improve for the grdview_surface gallery
core-man Mar 5, 2021
b1cfee9
Tiny improve for the scatter3d gallery
core-man Mar 5, 2021
29053d6
Tiny improve for the scatter3d gallery
core-man Mar 5, 2021
c75a5fd
Merge branch 'master' into imporve-doc
core-man Mar 6, 2021
467f3c8
Use cm instead of centimeters
core-man Mar 6, 2021
08fb5ea
Apply suggestions from code review
core-man Mar 6, 2021
b260f45
Update the doc for inset gallery
core-man Mar 6, 2021
df18b9e
Tiny improve for user guide for regions
core-man Mar 6, 2021
fb9f9c0
Tiny improve for user guide for plot
core-man Mar 6, 2021
d65d6b7
Tiny improve for user guide for text
core-man Mar 6, 2021
3143cf9
Apply suggestions from code review
core-man Mar 7, 2021
edf9201
Fix format
core-man Mar 7, 2021
ef54647
Merge branch 'master' into imporve-doc
core-man Mar 9, 2021
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
32 changes: 21 additions & 11 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ work, but there is no guarantee that PyGMT will behave as expected.

We recommend using the `Anaconda <https://www.anaconda.com/distribution>`__
Python distribution to ensure you have all dependencies installed and the
``conda`` package manager available.
Installing Anaconda does not require administrative rights to your computer and
doesn't interfere with any other Python installations in your system.
`conda <https://docs.conda.io/projects/conda/en/latest/>`__
package manager available. Installing Anaconda does not require administrative
rights to your computer and doesn't interfere with any other Python
installations in your system.


Which GMT?
Expand Down Expand Up @@ -110,14 +111,14 @@ Now we can create a new conda environment with Python and all our dependencies
installed (we'll call it ``pygmt`` but feel free to change it to whatever you
want)::

conda create --name pygmt python=3.9 pip numpy pandas xarray netcdf4 packaging gmt
conda create --name pygmt python=3.9 numpy pandas xarray netcdf4 packaging gmt

Activate the environment by running the following (**do not forget this step!**)::

conda activate pygmt

From now on, all commands will take place inside the conda virtual environment
called 'pygmt' and won't affect your default 'base' installation.
called ``pygmt`` and won't affect your default ``base`` installation.


Installing PyGMT
Expand All @@ -134,6 +135,10 @@ This installs the latest stable release of PyGMT from

conda install pygmt

This upgrades the installed PyGMT to be the latest stable release::

conda update pygmt

Using pip
~~~~~~~~~

Expand All @@ -142,6 +147,10 @@ This installs the latest stable release from

pip install pygmt

This upgrades the installed PyGMT to be the latest stable release::

pip install --upgrade pygmt

Alternatively, you can install the latest development version from
Comment thread
core-man marked this conversation as resolved.
Outdated
`TestPyPI <https://test.pypi.org/project/pygmt>`__::

Expand All @@ -152,8 +161,8 @@ or from PyGMT's `GitHub repository <https://github.com/GenericMappingTools/pygmt

pip install git+https://github.com/GenericMappingTools/pygmt.git#egg=pygmt

Any of the above methods (conda/pip) should allow you to use the ``pygmt``
library from Python.
Any of the above methods (conda/pip) should allow you to use the PyGMT library
Comment thread
core-man marked this conversation as resolved.
Outdated
from Python.
Comment thread
core-man marked this conversation as resolved.
Outdated


Testing your install
Expand Down Expand Up @@ -182,7 +191,8 @@ dependencies as well (be sure to have your conda environment activated)::

conda install pytest pytest-mpl ipython

Test your installation by running the following inside a Python interpreter::
Test your installation by running the following inside a Python interpreter
(note that it may take a few minutes)::

import pygmt
pygmt.show_versions()
Expand All @@ -193,14 +203,14 @@ Finding the GMT shared library
------------------------------

Sometimes, PyGMT will be unable to find the correct version of the GMT shared
library.
library (``libgmt``).
This can happen if you have multiple versions of GMT installed.

You can tell PyGMT exactly where to look for ``libgmt`` by setting the
``GMT_LIBRARY_PATH`` environment variable.
This should be set to the directory where ``libgmt.so``, ``libgmt.dylib`` or
``gmt.dll`` can be found for Linux, macOS and Windows respectively.
e.g. on a command line, run::
``gmt.dll`` can be found for Linux, macOS and Windows, respectively.
e.g., on a command line, run::

# Linux/macOS
export GMT_LIBRARY_PATH=$HOME/anaconda3/envs/pygmt/lib
Expand Down
14 changes: 8 additions & 6 deletions examples/tutorials/first-figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

.. note::

This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
This tutorial assumes the use of a Python notebook, such as `IPython <https://ipython.org/>`__
or `JupyterLab <https://jupyter.org/>`__.
To see the figures while using a Python script instead, use
``fig.show(method="external")`` to display the figure in the default PDF viewer.

Expand All @@ -34,11 +35,12 @@
fig = pygmt.Figure()

########################################################################################
# Add elements to the figure using its methods. For example, let's start a map with an
# automatic frame and ticks around a given longitude and latitude bound, set the
# projection to Mercator (``M``), and the map width to 8 inches:
# Add elements to the figure using its methods. For example, let's use
# :meth:`pygmt.Figure.basemap` to start a map for a region indicated by a given
# longitude and latitude bound, set the projection to Mercator (``M``), the
Comment thread
core-man marked this conversation as resolved.
Outdated
# map width to 8 centimeters, and frame type to be generated automatically:
Comment thread
core-man marked this conversation as resolved.
Outdated

fig.basemap(region=[-90, -70, 0, 20], projection="M8i", frame=True)
fig.basemap(region=[-90, -70, 0, 20], projection="M8c", frame=True)
Comment thread
seisman marked this conversation as resolved.

########################################################################################
# Now we can add coastlines using :meth:`pygmt.Figure.coast` to this map using the
Expand Down Expand Up @@ -80,7 +82,7 @@
# 1. The name of method is ``coast`` instead of ``pscoast``. As a general rule, all
# ``ps*`` modules had their ``ps`` prefix removed. The exceptions are:
# ``psxy`` which is now ``plot``, ``psxyz`` which is now ``plot3d``, and ``psscale``
# which is now ``colorbar``.
# which is now ``colorbar``. Those reflect the new GMT modern execution mode.
Comment thread
core-man marked this conversation as resolved.
Outdated
# 2. The parameters don't use the GMT 1-letter syntax (**R**, **J**, **B**, etc). We use longer
# aliases for these parameters and have some Python exclusive names. The mapping
# between the GMT parameters and their Python counterparts should be straight
Expand Down