From 8153d1c3949a9452f93c03b0dc12c1f81ce6f1f3 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Thu, 30 Dec 2021 07:39:39 +0000 Subject: [PATCH 1/6] add title section to first_figure.py --- examples/get-started/first_figure.py | 32 +++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/examples/get-started/first_figure.py b/examples/get-started/first_figure.py index 86346dc6f34..38d31467fbc 100644 --- a/examples/get-started/first_figure.py +++ b/examples/get-started/first_figure.py @@ -121,8 +121,7 @@ # annotate the latitude and longitude of the region. # # The ``frame`` parameter is used to add a frame to the figure. For now, it -# will be set to ``True`` to use default settings, but later tutorials will -# show how ``frame`` can be used to customize the axes, gridlines, and titles. +# will be set to ``"a"`` to use automatic settings. fig = pygmt.Figure() fig.coast( @@ -131,7 +130,34 @@ land="lightgreen", water="lightblue", projection="M10c", - frame=True, + frame="a", +) +fig.show() + +############################################################################### +# Add a title +# ----------- +# +# The ``frame`` parameter can be used to add a title to the figure. The title +# is set with by passing ``"+t"`` followed by the title (e.g. setting the map +# title to "Title" would be ``"+tTitle"``). +# +# To pass multiple arguments to ``frame``, a list can be used, as shown in the +# example below. This format uses ``frame`` to set both the axes gridlines and +# the figure title. +# +# If the figure title has multiple words, the string to set the title needs to +# use single-quotes, with the actual title set in double quotes (e.g. setting +# the title to "Coastal Maine" would use the syntax ``'+t"Coastal Maine"'``. + +fig = pygmt.Figure() +fig.coast( + region=[-69, -68, 43.75, 44.75], + shorelines=True, + land="lightgreen", + water="lightblue", + projection="M10c", + frame=["a", "+tMaine"], ) fig.show() From 7389fad32ca86b4fe258b01a1c721b894b07edb7 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Thu, 30 Dec 2021 14:14:19 +0000 Subject: [PATCH 2/6] Apply suggestions from code review Co-authored-by: Dongdong Tian --- examples/get-started/first_figure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get-started/first_figure.py b/examples/get-started/first_figure.py index 38d31467fbc..2fa200aa3d8 100644 --- a/examples/get-started/first_figure.py +++ b/examples/get-started/first_figure.py @@ -121,7 +121,7 @@ # annotate the latitude and longitude of the region. # # The ``frame`` parameter is used to add a frame to the figure. For now, it -# will be set to ``"a"`` to use automatic settings. +# will be set to ``"a"`` to use automatic annotation settings. fig = pygmt.Figure() fig.coast( From 8ee233ab2279ea04b752b8f970144811dce4be0d Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Thu, 30 Dec 2021 21:26:55 +0000 Subject: [PATCH 3/6] Update examples/get-started/first_figure.py Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- examples/get-started/first_figure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get-started/first_figure.py b/examples/get-started/first_figure.py index 2fa200aa3d8..bda17a87d27 100644 --- a/examples/get-started/first_figure.py +++ b/examples/get-started/first_figure.py @@ -146,7 +146,7 @@ # example below. This format uses ``frame`` to set both the axes gridlines and # the figure title. # -# If the figure title has multiple words, the string to set the title needs to +# If the figure title has any spaces, the string to set the title needs to # use single-quotes, with the actual title set in double quotes (e.g. setting # the title to "Coastal Maine" would use the syntax ``'+t"Coastal Maine"'``. From 7ac1f966c36010457aa150628865842227fd4900 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Sat, 1 Jan 2022 22:16:50 +0000 Subject: [PATCH 4/6] Update examples/get-started/first_figure.py Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- examples/get-started/first_figure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/get-started/first_figure.py b/examples/get-started/first_figure.py index bda17a87d27..4f6f89365a7 100644 --- a/examples/get-started/first_figure.py +++ b/examples/get-started/first_figure.py @@ -147,8 +147,8 @@ # the figure title. # # If the figure title has any spaces, the string to set the title needs to -# use single-quotes, with the actual title set in double quotes (e.g. setting -# the title to "Coastal Maine" would use the syntax ``'+t"Coastal Maine"'``. +# be wrapped in single-quotes, while the actual title is set in double quotes +# (e.g. setting the title to "A Title" would use the syntax ``'+t"A Title"'``. fig = pygmt.Figure() fig.coast( From 25f8a8aebefc30771e7d23fd8a4f9cf236557fd4 Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Sun, 2 Jan 2022 09:53:32 +0000 Subject: [PATCH 5/6] Update examples/get-started/first_figure.py Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- examples/get-started/first_figure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get-started/first_figure.py b/examples/get-started/first_figure.py index 4f6f89365a7..1288f8c8909 100644 --- a/examples/get-started/first_figure.py +++ b/examples/get-started/first_figure.py @@ -121,7 +121,7 @@ # annotate the latitude and longitude of the region. # # The ``frame`` parameter is used to add a frame to the figure. For now, it -# will be set to ``"a"`` to use automatic annotation settings. +# will be set to ``"a"`` to **a**nnotate the axes automatically. fig = pygmt.Figure() fig.coast( From 606ee98ebeb4e77ca09f3970d5f6ac8cdcb6605a Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Mon, 3 Jan 2022 08:00:12 +0000 Subject: [PATCH 6/6] fix bold notation --- examples/get-started/first_figure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get-started/first_figure.py b/examples/get-started/first_figure.py index 1288f8c8909..3fa1c1cc42f 100644 --- a/examples/get-started/first_figure.py +++ b/examples/get-started/first_figure.py @@ -121,7 +121,7 @@ # annotate the latitude and longitude of the region. # # The ``frame`` parameter is used to add a frame to the figure. For now, it -# will be set to ``"a"`` to **a**nnotate the axes automatically. +# will be set to ``"a"`` to **a**\ nnotate the axes automatically. fig = pygmt.Figure() fig.coast(