Skip to content

Commit

Permalink
Tutorial notebook explanation (#806)
Browse files Browse the repository at this point in the history
*Add a note in all tutorial examples to explain the use of a Python notebook

Co-authored-by: Dongdong Tian <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
  • Loading branch information
3 people authored Feb 11, 2021
1 parent 4deb8c2 commit 394c847
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/tutorials/3d-perspective-image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
Create 3-D perspective image or surface mesh from a grid
using :meth:`pygmt.Figure.grdview`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 7

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/coastlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
======================
Plotting coastlines and borders is handled by :meth:`pygmt.Figure.coast`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 5

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
==========================
Default GMT parameters can be set globally or locally using :class:`pygmt.config`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 3

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/contour-map.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
=================================
Plotting a contour map is handled by :meth:`pygmt.Figure.grdcontour`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 5

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/earth-relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
Plotting a map of Earth relief can use the data accessed by the
:meth:`pygmt.datasets.load_earth_relief` method. The data can then be plotted using the
:meth:`pygmt.Figure.grdimage` method.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 5

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/first-figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
Welcome to PyGMT! Here we'll cover some of basic concepts, like creating simple figures
and naming conventions.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""

########################################################################################
Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
Setting the style of the map frames, ticks, etc, is handled by the ``frame`` argument
that all plotting methods of :class:`pygmt.Figure`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 4

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/inset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
:meth:`pygmt.Figure.inset` method. After a large figure has been created,
call ``inset`` using a ``with`` statement, and new plot elements will be
added to the inset figure instead of the larger figure.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 4

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
==========
Plotting lines is handled by :meth:`pygmt.Figure.plot`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 3

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
:mod:`pygmt.datasets` package. If you don't have the data files already, they are
automatically downloaded and saved to a cache directory the first time you use them
(usually ``~/.gmt/cache``).
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 3

Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
Many of the plotting functions take the ``region`` argument, which sets
the area that will be shown in the figure. This tutorial covers the different types of
inputs that it can accept.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""

import pygmt
Expand Down
9 changes: 9 additions & 0 deletions examples/tutorials/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
It is often useful to add annotations to a map plot. This is handled by
:meth:`pygmt.Figure.text`.
.. note::
This tutorial assumes the use of a Python notebook, such as IPython or Jupyter Notebook.
To see the figures while using a Python script instead, use
``fig.show(method="external)`` to display the figure in the default PDF viewer.
To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"``
is the desired name and file extension for the saved figure.
"""
# sphinx_gallery_thumbnail_number = 3

Expand Down

0 comments on commit 394c847

Please sign in to comment.