From 27f5d20b85cd1bbfd237ef8e7e0455d07a6efb4d Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Fri, 11 Dec 2020 09:59:50 +0000 Subject: [PATCH 01/16] Add cyl_transverse_mercator.py --- .../cyl/cyl_transverse_mercator.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/projections/cyl/cyl_transverse_mercator.py diff --git a/examples/projections/cyl/cyl_transverse_mercator.py b/examples/projections/cyl/cyl_transverse_mercator.py new file mode 100644 index 00000000000..fc8bb2198b9 --- /dev/null +++ b/examples/projections/cyl/cyl_transverse_mercator.py @@ -0,0 +1,19 @@ +""" +Transverse Mercator +=================== + +``T[lon0/][lat0/]width``: Give central meridian ``lon0``, the latitude of the +origin ``lat0`` (optional), and the figure width. +""" +import pygmt + +fig = pygmt.Figure() +fig.coast( + region=[20, 50, 30, 45], + projection="T35/12c", + land="lightbrown", + water="seashell", + shorelines="thinnest", + frame="afg", +) +fig.show() From d64983ff1ae3e046ba76697f8980e12c4600475c Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Fri, 11 Dec 2020 10:40:06 +0000 Subject: [PATCH 02/16] Add cyl_universal_transverse_mercator.py --- .../cyl/cyl_universal_transverse_mercator.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/projections/cyl/cyl_universal_transverse_mercator.py diff --git a/examples/projections/cyl/cyl_universal_transverse_mercator.py b/examples/projections/cyl/cyl_universal_transverse_mercator.py new file mode 100644 index 00000000000..47259c5bd6c --- /dev/null +++ b/examples/projections/cyl/cyl_universal_transverse_mercator.py @@ -0,0 +1,19 @@ +""" +Universal Transverse Mercator +============================= + +``U[UTM Zone/][lat0/]width``: Give UTM Zone ``UTM Zone``, and the figure width. +""" +import pygmt + +fig = pygmt.Figure() +# UTM Zone is set to 52R +fig.coast( + region=[127.5, 128.5, 26, 27], + projection="U52R/12c", + land="lightgreen", + water="lightblue", + shorelines="thinnest", + frame="afg", +) +fig.show() From 6ba8185f68bc7dbc76a2787540083287204a7ea4 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Fri, 11 Dec 2020 10:48:29 +0000 Subject: [PATCH 03/16] Changing land color to red in cyl_mercator.py to match GMT docs example; changing units from US to SI --- examples/projections/cyl/cyl_mercator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/projections/cyl/cyl_mercator.py b/examples/projections/cyl/cyl_mercator.py index d2e54886e6f..bfe22ba87a9 100644 --- a/examples/projections/cyl/cyl_mercator.py +++ b/examples/projections/cyl/cyl_mercator.py @@ -8,5 +8,5 @@ import pygmt fig = pygmt.Figure() -fig.coast(region=[0, 360, -80, 80], frame="afg", land="gray", projection="M0/0/8i") +fig.coast(region=[0, 360, -80, 80], frame="afg", land="red", projection="M0/0/12c") fig.show() From 5054ae4e28166f37f914384856860435a14c9e3f Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:31:19 +0000 Subject: [PATCH 04/16] Add notebook explanation to 3d-perspective-image.py --- examples/tutorials/3d-perspective-image.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/3d-perspective-image.py b/examples/tutorials/3d-perspective-image.py index 76573e9a60e..4cd8f95714a 100644 --- a/examples/tutorials/3d-perspective-image.py +++ b/examples/tutorials/3d-perspective-image.py @@ -4,6 +4,13 @@ Create 3-D perspective image or surface mesh from a grid using :meth:`pygmt.Figure.grdview`. + +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 From e64dfa866cdd0a7f356450c0df2d4c342b576e72 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:42:12 +0000 Subject: [PATCH 05/16] Add notebook explanation to coastlines.py --- examples/tutorials/coastlines.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/coastlines.py b/examples/tutorials/coastlines.py index 98ca1f0afac..507902649d7 100644 --- a/examples/tutorials/coastlines.py +++ b/examples/tutorials/coastlines.py @@ -3,6 +3,13 @@ ====================== Plotting coastlines and borders is handled by :meth:`pygmt.Figure.coast`. + +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 From f85d1ef213943b2f24d2c54b40e2cbf3bef02e21 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:43:18 +0000 Subject: [PATCH 06/16] Add notebook explanation to configuration.py --- examples/tutorials/configuration.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/configuration.py b/examples/tutorials/configuration.py index 35be16106d9..75cf735e2c2 100644 --- a/examples/tutorials/configuration.py +++ b/examples/tutorials/configuration.py @@ -3,6 +3,13 @@ ========================== Default GMT parameters can be set globally or locally using :class:`pygmt.config`. + +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 From 5c1298b87f16b81f9d97d7036f316ef6b9a055e2 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:43:44 +0000 Subject: [PATCH 07/16] Add notebook explanation to contour-map.py --- examples/tutorials/contour-map.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/contour-map.py b/examples/tutorials/contour-map.py index 2d80af168ea..22050bdfb54 100644 --- a/examples/tutorials/contour-map.py +++ b/examples/tutorials/contour-map.py @@ -3,6 +3,13 @@ ================================= Plotting a contour map is handled by :meth:`pygmt.Figure.grdcontour`. + +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 From 76a0d34861e675009eea2b10ad6321f2e53aaf64 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:43:56 +0000 Subject: [PATCH 08/16] Add notebook explanation to earth-relief.py --- examples/tutorials/earth-relief.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/earth-relief.py b/examples/tutorials/earth-relief.py index cd7a7b15a1d..e039e75cb39 100644 --- a/examples/tutorials/earth-relief.py +++ b/examples/tutorials/earth-relief.py @@ -5,6 +5,13 @@ 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. + +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 From 0d6450ad845157a61c4ab1e2bfbd1da3dedd5e54 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:44:15 +0000 Subject: [PATCH 09/16] Add notebook explanation to first-figure.py --- examples/tutorials/first-figure.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/first-figure.py b/examples/tutorials/first-figure.py index 40dce53a050..6579737ba40 100644 --- a/examples/tutorials/first-figure.py +++ b/examples/tutorials/first-figure.py @@ -4,6 +4,13 @@ Welcome to PyGMT! Here we'll cover some of basic concepts, like creating simple figures and naming conventions. + +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. """ ######################################################################################## From 40750d3c402f3ac2dc02f547d6680c4ef74ab8cb Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:44:28 +0000 Subject: [PATCH 10/16] Add notebook explanation to frames.py --- examples/tutorials/frames.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/frames.py b/examples/tutorials/frames.py index 8bc40801a20..515ccbce30c 100644 --- a/examples/tutorials/frames.py +++ b/examples/tutorials/frames.py @@ -4,6 +4,13 @@ Setting the style of the map frames, ticks, etc, is handled by the ``frame`` argument that all plotting methods of :class:`pygmt.Figure`. + +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 From c879209f52833c50749d792096ece61b43aade8e Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:44:46 +0000 Subject: [PATCH 11/16] Add notebook explanation to plot.py --- examples/tutorials/plot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/plot.py b/examples/tutorials/plot.py index 3a41b9198e1..ab574022e51 100644 --- a/examples/tutorials/plot.py +++ b/examples/tutorials/plot.py @@ -7,6 +7,13 @@ :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``). + +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 From 47f3fa4cbbfb632d60565552c804a8033403abb8 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:44:59 +0000 Subject: [PATCH 12/16] Add notebook explanation to plot-lines.py --- examples/tutorials/plot-lines.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/plot-lines.py b/examples/tutorials/plot-lines.py index 5cd83cb4441..f73a222cabb 100644 --- a/examples/tutorials/plot-lines.py +++ b/examples/tutorials/plot-lines.py @@ -3,6 +3,13 @@ ========== Plotting lines is handled by :meth:`pygmt.Figure.plot`. + +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 From 23b0e8a65635a590b0325ba0b4408060768182ed Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:45:12 +0000 Subject: [PATCH 13/16] Add notebook explanation to regions.py --- examples/tutorials/regions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/regions.py b/examples/tutorials/regions.py index 82542494749..61651581755 100644 --- a/examples/tutorials/regions.py +++ b/examples/tutorials/regions.py @@ -5,6 +5,13 @@ 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. + +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 From 78659240fbd4e114992b417c2059ab44b44abaf1 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Tue, 26 Jan 2021 07:45:28 +0000 Subject: [PATCH 14/16] Add notebook explanation to text.py --- examples/tutorials/text.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/tutorials/text.py b/examples/tutorials/text.py index a411affb5b9..ec4aef3bf12 100644 --- a/examples/tutorials/text.py +++ b/examples/tutorials/text.py @@ -4,6 +4,13 @@ It is often useful to add annotations to a map plot. This is handled by :meth:`pygmt.Figure.text`. + +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 os From 93bc01bb0e3cc4bddde206cf83fe699c7644f173 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Wed, 10 Feb 2021 14:09:17 +0000 Subject: [PATCH 15/16] Update examples/tutorials/3d-perspective-image.py Co-authored-by: Dongdong Tian --- examples/tutorials/3d-perspective-image.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/tutorials/3d-perspective-image.py b/examples/tutorials/3d-perspective-image.py index 7a6dbc58dcb..e7e41038b3b 100644 --- a/examples/tutorials/3d-perspective-image.py +++ b/examples/tutorials/3d-perspective-image.py @@ -5,12 +5,14 @@ Create 3-D perspective image or surface mesh from a grid using :meth:`pygmt.Figure.grdview`. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 From dd3ab298c55c978a35134395da4cb262d4f67957 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Wed, 10 Feb 2021 14:11:46 +0000 Subject: [PATCH 16/16] Update notebook explanation to use note annotation --- examples/tutorials/coastlines.py | 12 +++++++----- examples/tutorials/configuration.py | 12 +++++++----- examples/tutorials/contour-map.py | 12 +++++++----- examples/tutorials/earth-relief.py | 12 +++++++----- examples/tutorials/first-figure.py | 12 +++++++----- examples/tutorials/frames.py | 12 +++++++----- examples/tutorials/inset.py | 9 +++++++++ examples/tutorials/lines.py | 12 +++++++----- examples/tutorials/plot.py | 12 +++++++----- examples/tutorials/regions.py | 12 +++++++----- examples/tutorials/text.py | 12 +++++++----- 11 files changed, 79 insertions(+), 50 deletions(-) diff --git a/examples/tutorials/coastlines.py b/examples/tutorials/coastlines.py index 68d50e59077..4e6d0bbff92 100644 --- a/examples/tutorials/coastlines.py +++ b/examples/tutorials/coastlines.py @@ -4,12 +4,14 @@ Plotting coastlines and borders is handled by :meth:`pygmt.Figure.coast`. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/configuration.py b/examples/tutorials/configuration.py index bdfeb498091..5bd84620327 100644 --- a/examples/tutorials/configuration.py +++ b/examples/tutorials/configuration.py @@ -4,12 +4,14 @@ Default GMT parameters can be set globally or locally using :class:`pygmt.config`. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/contour-map.py b/examples/tutorials/contour-map.py index 2a5cf14ab7e..6531c7ccee9 100644 --- a/examples/tutorials/contour-map.py +++ b/examples/tutorials/contour-map.py @@ -4,12 +4,14 @@ Plotting a contour map is handled by :meth:`pygmt.Figure.grdcontour`. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/earth-relief.py b/examples/tutorials/earth-relief.py index 1066572bbf7..d818e24264c 100644 --- a/examples/tutorials/earth-relief.py +++ b/examples/tutorials/earth-relief.py @@ -6,12 +6,14 @@ :meth:`pygmt.datasets.load_earth_relief` method. The data can then be plotted using the :meth:`pygmt.Figure.grdimage` method. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/first-figure.py b/examples/tutorials/first-figure.py index 6579737ba40..3dab39ba4e6 100644 --- a/examples/tutorials/first-figure.py +++ b/examples/tutorials/first-figure.py @@ -5,12 +5,14 @@ Welcome to PyGMT! Here we'll cover some of basic concepts, like creating simple figures and naming conventions. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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. """ ######################################################################################## diff --git a/examples/tutorials/frames.py b/examples/tutorials/frames.py index aa3b6fad3f6..1bfc5381089 100644 --- a/examples/tutorials/frames.py +++ b/examples/tutorials/frames.py @@ -5,12 +5,14 @@ Setting the style of the map frames, ticks, etc, is handled by the ``frame`` argument that all plotting methods of :class:`pygmt.Figure`. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/inset.py b/examples/tutorials/inset.py index 7d6b0b98b49..4af6cf00bf6 100644 --- a/examples/tutorials/inset.py +++ b/examples/tutorials/inset.py @@ -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 diff --git a/examples/tutorials/lines.py b/examples/tutorials/lines.py index 916f24301df..7e56d57fe0b 100644 --- a/examples/tutorials/lines.py +++ b/examples/tutorials/lines.py @@ -4,12 +4,14 @@ Plotting lines is handled by :meth:`pygmt.Figure.plot`. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/plot.py b/examples/tutorials/plot.py index 97ddc36016e..352a541b1d4 100644 --- a/examples/tutorials/plot.py +++ b/examples/tutorials/plot.py @@ -8,12 +8,14 @@ automatically downloaded and saved to a cache directory the first time you use them (usually ``~/.gmt/cache``). -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/regions.py b/examples/tutorials/regions.py index 25b7af890f2..3cc1a88a286 100644 --- a/examples/tutorials/regions.py +++ b/examples/tutorials/regions.py @@ -6,12 +6,14 @@ the area that will be shown in the figure. This tutorial covers the different types of inputs that it can accept. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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 diff --git a/examples/tutorials/text.py b/examples/tutorials/text.py index c950a80f2d1..9c8c1116a60 100644 --- a/examples/tutorials/text.py +++ b/examples/tutorials/text.py @@ -5,12 +5,14 @@ It is often useful to add annotations to a map plot. This is handled by :meth:`pygmt.Figure.text`. -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. +.. note:: -To save the figure, use ``fig.savefig("figname.pdf")`` where ``"figname.pdf"`` -is the desired name and file extension for the saved figure. + 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