From b8e74fec1b1c8172b55bd42864ef6947b3be4504 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 4 Jun 2023 22:10:38 +0200 Subject: [PATCH 01/19] Add basic code for example 'decorated lines' --- examples/gallery/lines/decoratedlines.py | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 examples/gallery/lines/decoratedlines.py diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py new file mode 100755 index 00000000000..38adff20f6b --- /dev/null +++ b/examples/gallery/lines/decoratedlines.py @@ -0,0 +1,84 @@ +""" +Decorated lines +--------------- +Use ``style`` parameter with argument ``"~"`` in :meth:`pygmt.Figure.method` +Similarity to line fronts, for details see +:doc:`Line styles example ` +Point out what is different +Also add link in example Line fronts +Hybrid of fronts and quoted lines +Unclear `"+a"` does nothing, should change angle similar to quoted lines +Change base line via ``pen`` parameter, see the +:doc:`Line styles example `. +Also, custom symbols can be used, see +:doc:`Custom symbols example `. +For more modifications, see upstream GMT documentation at xyz +TODO - nice formulation +""" + + +import numpy as np +import pygmt + +# Generate a two-point line for plotting +x = np.array([1, 4]) +y = np.array([24, 24]) + +fig = pygmt.Figure() +fig.basemap( + region=[0, 10, 0, 24], + projection="X15c", + frame="+tDecorated Lines", +) + +# Plot different decorated lines +for frontstyle in [ + # xxx + "~d1c:+sc0.5c", + # xxx + "~d1c:+sc0.5c+p1p,blue", + # xxx + "~d1c:+sc0.5c+p1p,blue,-", + # xxx + "~d1c:+sc0.5c+glightblue", + # xxx + "~d1c:+sc0.5c+glightblue+p1p,blue", + # xxx + "~d1c:+sc0.5c+gp8+p1p,blue", + # xxx + "~d1c:+st0.5c+gtan+p1p,black", + # xxx + "~d0.4c:+si0.3c+gtan+p1p,black", + # xxx + "~d1c:+ss0.7c+gtan+p1p,black", + # xxx + "~d1c:+sd0.5c+gtan+p1p,black+n-0.2c/0.1c", + # xxx + "~n6:+sn0.5c+gtan+p1p,black", + # xxx + "~N6:+sh0.5c+gtan+p1p,black", + # xxx + "~d1c:+sg0.5c+gtan+p1p,black+i", + # xxx analog N+1 für Ende + "~N-1:+sp0.2c+gblack", + # xxx + "~d1c:+sa0.5c+ggold+p1p,black", + # xxx + "~d1c:+sx0.5c+p2p,red", + # xxx + "~d0.5c:+sy0.5c+p5p,brown", + # xxx + "~d1c:+sksquaroid/0.5c+ggray+p1p,black", +]: + y = y - 1.2 # Move current line down + fig.plot(x=x, y=y, pen="1.25p,black") + fig.text( + x=x[-1], + y=y[-1], + text=frontstyle, + font="Courier-Bold", + justify="ML", + offset="0.75c/0c", + ) + +fig.show() From a10007d483a465dea3e4f7cbc68da82bb0ddf742 Mon Sep 17 00:00:00 2001 From: actions-bot <58130806+actions-bot@users.noreply.github.com> Date: Sun, 4 Jun 2023 20:25:03 +0000 Subject: [PATCH 02/19] [format-command] fixes --- examples/gallery/lines/decoratedlines.py | 168 +++++++++++------------ 1 file changed, 84 insertions(+), 84 deletions(-) mode change 100755 => 100644 examples/gallery/lines/decoratedlines.py diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py old mode 100755 new mode 100644 index 38adff20f6b..faffe3b77ac --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -1,84 +1,84 @@ -""" -Decorated lines ---------------- -Use ``style`` parameter with argument ``"~"`` in :meth:`pygmt.Figure.method` -Similarity to line fronts, for details see -:doc:`Line styles example ` -Point out what is different -Also add link in example Line fronts -Hybrid of fronts and quoted lines -Unclear `"+a"` does nothing, should change angle similar to quoted lines -Change base line via ``pen`` parameter, see the -:doc:`Line styles example `. -Also, custom symbols can be used, see -:doc:`Custom symbols example `. -For more modifications, see upstream GMT documentation at xyz -TODO - nice formulation -""" - - -import numpy as np -import pygmt - -# Generate a two-point line for plotting -x = np.array([1, 4]) -y = np.array([24, 24]) - -fig = pygmt.Figure() -fig.basemap( - region=[0, 10, 0, 24], - projection="X15c", - frame="+tDecorated Lines", -) - -# Plot different decorated lines -for frontstyle in [ - # xxx - "~d1c:+sc0.5c", - # xxx - "~d1c:+sc0.5c+p1p,blue", - # xxx - "~d1c:+sc0.5c+p1p,blue,-", - # xxx - "~d1c:+sc0.5c+glightblue", - # xxx - "~d1c:+sc0.5c+glightblue+p1p,blue", - # xxx - "~d1c:+sc0.5c+gp8+p1p,blue", - # xxx - "~d1c:+st0.5c+gtan+p1p,black", - # xxx - "~d0.4c:+si0.3c+gtan+p1p,black", - # xxx - "~d1c:+ss0.7c+gtan+p1p,black", - # xxx - "~d1c:+sd0.5c+gtan+p1p,black+n-0.2c/0.1c", - # xxx - "~n6:+sn0.5c+gtan+p1p,black", - # xxx - "~N6:+sh0.5c+gtan+p1p,black", - # xxx - "~d1c:+sg0.5c+gtan+p1p,black+i", - # xxx analog N+1 für Ende - "~N-1:+sp0.2c+gblack", - # xxx - "~d1c:+sa0.5c+ggold+p1p,black", - # xxx - "~d1c:+sx0.5c+p2p,red", - # xxx - "~d0.5c:+sy0.5c+p5p,brown", - # xxx - "~d1c:+sksquaroid/0.5c+ggray+p1p,black", -]: - y = y - 1.2 # Move current line down - fig.plot(x=x, y=y, pen="1.25p,black") - fig.text( - x=x[-1], - y=y[-1], - text=frontstyle, - font="Courier-Bold", - justify="ML", - offset="0.75c/0c", - ) - -fig.show() +""" +Decorated lines +--------------- +Use ``style`` parameter with argument ``"~"`` in :meth:`pygmt.Figure.method` +Similarity to line fronts, for details see +:doc:`Line styles example ` +Point out what is different +Also add link in example Line fronts +Hybrid of fronts and quoted lines +Unclear `"+a"` does nothing, should change angle similar to quoted lines +Change base line via ``pen`` parameter, see the +:doc:`Line styles example `. +Also, custom symbols can be used, see +:doc:`Custom symbols example `. +For more modifications, see upstream GMT documentation at xyz +TODO - nice formulation +""" + + +import numpy as np +import pygmt + +# Generate a two-point line for plotting +x = np.array([1, 4]) +y = np.array([24, 24]) + +fig = pygmt.Figure() +fig.basemap( + region=[0, 10, 0, 24], + projection="X15c", + frame="+tDecorated Lines", +) + +# Plot different decorated lines +for frontstyle in [ + # xxx + "~d1c:+sc0.5c", + # xxx + "~d1c:+sc0.5c+p1p,blue", + # xxx + "~d1c:+sc0.5c+p1p,blue,-", + # xxx + "~d1c:+sc0.5c+glightblue", + # xxx + "~d1c:+sc0.5c+glightblue+p1p,blue", + # xxx + "~d1c:+sc0.5c+gp8+p1p,blue", + # xxx + "~d1c:+st0.5c+gtan+p1p,black", + # xxx + "~d0.4c:+si0.3c+gtan+p1p,black", + # xxx + "~d1c:+ss0.7c+gtan+p1p,black", + # xxx + "~d1c:+sd0.5c+gtan+p1p,black+n-0.2c/0.1c", + # xxx + "~n6:+sn0.5c+gtan+p1p,black", + # xxx + "~N6:+sh0.5c+gtan+p1p,black", + # xxx + "~d1c:+sg0.5c+gtan+p1p,black+i", + # xxx analog N+1 für Ende + "~N-1:+sp0.2c+gblack", + # xxx + "~d1c:+sa0.5c+ggold+p1p,black", + # xxx + "~d1c:+sx0.5c+p2p,red", + # xxx + "~d0.5c:+sy0.5c+p5p,brown", + # xxx + "~d1c:+sksquaroid/0.5c+ggray+p1p,black", +]: + y = y - 1.2 # Move current line down + fig.plot(x=x, y=y, pen="1.25p,black") + fig.text( + x=x[-1], + y=y[-1], + text=frontstyle, + font="Courier-Bold", + justify="ML", + offset="0.75c/0c", + ) + +fig.show() From 9e100e797e31a3b3159fc92b73e597de00747d14 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 4 Jun 2023 22:31:44 +0200 Subject: [PATCH 03/19] Update introduction text --- examples/gallery/lines/decoratedlines.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index faffe3b77ac..acee62ce421 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -1,14 +1,16 @@ """ Decorated lines --------------- -Use ``style`` parameter with argument ``"~"`` in :meth:`pygmt.Figure.method` -Similarity to line fronts, for details see -:doc:`Line styles example ` +To draw so-called *decorated lines*, i.e., lines with symbols, +use the ``style`` parameter of :meth:`pygmt.Figure.plot` +with argument ``"~"``. There are similarity to line fronts +(see :doc:`Line styles example `). Point out what is different Also add link in example Line fronts Hybrid of fronts and quoted lines -Unclear `"+a"` does nothing, should change angle similar to quoted lines -Change base line via ``pen`` parameter, see the +Unclear `"+a"` does nothing, should change angle simliar to +quoted lines +Change base line via ``pen`` parameter, see the :doc:`Line styles example `. Also, custom symbols can be used, see :doc:`Custom symbols example `. From b52f8dc867d22ebbe4e3a48dc0018ed59cb000ea Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 4 Jun 2023 23:38:18 +0200 Subject: [PATCH 04/19] Add missing parameter 'fill' --- examples/gallery/lines/decoratedlines.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index acee62ce421..1b6e7f76737 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -34,7 +34,7 @@ ) # Plot different decorated lines -for frontstyle in [ +for decoline in [ # xxx "~d1c:+sc0.5c", # xxx @@ -73,11 +73,11 @@ "~d1c:+sksquaroid/0.5c+ggray+p1p,black", ]: y = y - 1.2 # Move current line down - fig.plot(x=x, y=y, pen="1.25p,black") + fig.plot(x=x, y=y, style=decoline, pen="1.25p,black") fig.text( x=x[-1], y=y[-1], - text=frontstyle, + text=decoline, font="Courier-Bold", justify="ML", offset="0.75c/0c", From 911d440b9522f9972d17f4656ed908393956e2de Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 11 Jun 2023 10:59:37 +0200 Subject: [PATCH 05/19] Add comments for 'decorated lines' --- examples/gallery/lines/decoratedlines.py | 44 +++++++++++++----------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index 1b6e7f76737..df5603e6aa6 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -35,41 +35,43 @@ # Plot different decorated lines for decoline in [ - # xxx + # Line with circle ("+sc") of 0.5 centimeters radius in distance of + # 1 centimeter "~d1c:+sc0.5c", - # xxx - "~d1c:+sc0.5c+p1p,blue", - # xxx + # Adjust thickness, color, and style of the outline via "+p" + # Here, we plot a 1 point thick, blue, dashed outline "~d1c:+sc0.5c+p1p,blue,-", - # xxx + # Add a fill color using "+g" with the desired color "~d1c:+sc0.5c+glightblue", - # xxx - "~d1c:+sc0.5c+glightblue+p1p,blue", - # xxx + # To use a pattern as fill by append "p" and give the pattern number "~d1c:+sc0.5c+gp8+p1p,blue", - # xxx + # Line with tringles ("t") "~d1c:+st0.5c+gtan+p1p,black", - # xxx + # Line with inverse triangles with a size of 0.3 centimeters in a + # distance of 0.4 centimeters "~d0.4c:+si0.3c+gtan+p1p,black", - # xxx + # Line with squars ("s") with a size of 0.7 centimeters in a distance of + # 1 centimeter "~d1c:+ss0.7c+gtan+p1p,black", - # xxx + # Shift symobls using "+n" in x and y directions relative to the base line "~d1c:+sd0.5c+gtan+p1p,black+n-0.2c/0.1c", - # xxx + # Give the number of equaly spaced symbols by using "n" instead of "d" "~n6:+sn0.5c+gtan+p1p,black", - # xxx + # Use upper-case "N" to have symbols at start and end of the line "~N6:+sh0.5c+gtan+p1p,black", - # xxx + # Suppress the base line by appending "+i" "~d1c:+sg0.5c+gtan+p1p,black+i", - # xxx analog N+1 für Ende - "~N-1:+sp0.2c+gblack", - # xxx + # To only plot a symoble a the start of the line use "N-1" + "~N-1:+sp0.2c+gblack", + # To only plot a symoble a the end of the line use "N+1" + "~N+1:+sp0.2c+gblack", + # Line with stars ("a") "~d1c:+sa0.5c+ggold+p1p,black", - # xxx + # Line with crosses ("x") "~d1c:+sx0.5c+p2p,red", - # xxx + # Line with (vertical) lines or bars ("y") "~d0.5c:+sy0.5c+p5p,brown", - # xxx + # Use custom symbol ("k") "squaroid" with a size of 0.5 centimeters "~d1c:+sksquaroid/0.5c+ggray+p1p,black", ]: y = y - 1.2 # Move current line down From 9ae5c753acffc1994c580f86425b82e219a83b54 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 11 Jun 2023 11:04:42 +0200 Subject: [PATCH 06/19] Fix typos --- examples/gallery/lines/decoratedlines.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index df5603e6aa6..84e013f6312 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -39,7 +39,7 @@ # 1 centimeter "~d1c:+sc0.5c", # Adjust thickness, color, and style of the outline via "+p" - # Here, we plot a 1 point thick, blue, dashed outline + # Here, we plot a 1-point thick, blue, dashed outline "~d1c:+sc0.5c+p1p,blue,-", # Add a fill color using "+g" with the desired color "~d1c:+sc0.5c+glightblue", @@ -50,20 +50,20 @@ # Line with inverse triangles with a size of 0.3 centimeters in a # distance of 0.4 centimeters "~d0.4c:+si0.3c+gtan+p1p,black", - # Line with squars ("s") with a size of 0.7 centimeters in a distance of + # Line with squares ("s") with a size of 0.7 centimeters in a distance of # 1 centimeter "~d1c:+ss0.7c+gtan+p1p,black", - # Shift symobls using "+n" in x and y directions relative to the base line + # Shift symbols using "+n" in x and y directions relative to the base line "~d1c:+sd0.5c+gtan+p1p,black+n-0.2c/0.1c", - # Give the number of equaly spaced symbols by using "n" instead of "d" + # Give the number of equally spaced symbols by using "n" instead of "d" "~n6:+sn0.5c+gtan+p1p,black", # Use upper-case "N" to have symbols at start and end of the line "~N6:+sh0.5c+gtan+p1p,black", # Suppress the base line by appending "+i" "~d1c:+sg0.5c+gtan+p1p,black+i", - # To only plot a symoble a the start of the line use "N-1" + # To only plot a symbol at the start of the line use "N-1" "~N-1:+sp0.2c+gblack", - # To only plot a symoble a the end of the line use "N+1" + # To only plot a symbol at the end of the line use "N+1" "~N+1:+sp0.2c+gblack", # Line with stars ("a") "~d1c:+sa0.5c+ggold+p1p,black", From df37b62c402437a745ee5a1b17d3295f6a017934 Mon Sep 17 00:00:00 2001 From: actions-bot <58130806+actions-bot@users.noreply.github.com> Date: Sun, 11 Jun 2023 09:34:57 +0000 Subject: [PATCH 07/19] [format-command] fixes --- examples/gallery/lines/decoratedlines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index 84e013f6312..97adae5a880 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -62,7 +62,7 @@ # Suppress the base line by appending "+i" "~d1c:+sg0.5c+gtan+p1p,black+i", # To only plot a symbol at the start of the line use "N-1" - "~N-1:+sp0.2c+gblack", + "~N-1:+sp0.2c+gblack", # To only plot a symbol at the end of the line use "N+1" "~N+1:+sp0.2c+gblack", # Line with stars ("a") From 8177bb4858c624fec5c041c5d1330dc0a65b1a3c Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 11 Jun 2023 11:56:57 +0200 Subject: [PATCH 08/19] Fix typos --- examples/gallery/lines/decoratedlines.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index 97adae5a880..c3d1fcefa10 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -35,7 +35,7 @@ # Plot different decorated lines for decoline in [ - # Line with circle ("+sc") of 0.5 centimeters radius in distance of + # Line with circles ("c") of 0.5 centimeters radius in distance of # 1 centimeter "~d1c:+sc0.5c", # Adjust thickness, color, and style of the outline via "+p" @@ -43,9 +43,9 @@ "~d1c:+sc0.5c+p1p,blue,-", # Add a fill color using "+g" with the desired color "~d1c:+sc0.5c+glightblue", - # To use a pattern as fill by append "p" and give the pattern number + # To use a pattern as fill append "p" and give the pattern number "~d1c:+sc0.5c+gp8+p1p,blue", - # Line with tringles ("t") + # Line with triangles ("t") "~d1c:+st0.5c+gtan+p1p,black", # Line with inverse triangles with a size of 0.3 centimeters in a # distance of 0.4 centimeters @@ -57,7 +57,7 @@ "~d1c:+sd0.5c+gtan+p1p,black+n-0.2c/0.1c", # Give the number of equally spaced symbols by using "n" instead of "d" "~n6:+sn0.5c+gtan+p1p,black", - # Use upper-case "N" to have symbols at start and end of the line + # Use upper-case "N" to have symbols at the start and end of the line "~N6:+sh0.5c+gtan+p1p,black", # Suppress the base line by appending "+i" "~d1c:+sg0.5c+gtan+p1p,black+i", From 4804c9058fec20b5f4abd9b3b8727e93c5a159bd Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 11 Jun 2023 18:24:58 +0200 Subject: [PATCH 09/19] Formulate introduction --- examples/gallery/lines/decoratedlines.py | 27 ++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index c3d1fcefa10..333c8887f27 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -1,21 +1,22 @@ """ Decorated lines --------------- -To draw so-called *decorated lines*, i.e., lines with symbols, -use the ``style`` parameter of :meth:`pygmt.Figure.plot` -with argument ``"~"``. There are similarity to line fronts -(see :doc:`Line styles example `). -Point out what is different +To draw a so-called *decorated line*, i.e., symbols along a line +or curve, use the ``style`` parameter of the +:meth:`pygmt.Figure.plot` method with argument ``"~"`` with the +desired modifiers. This example focuses on adjusting the symbols. +Beside the build-in symbols also custom symbols can be used. +There are similarities to so-called *fronts*, often used to plot +fault lines, subduction zones, or weather fronts; for details +see :doc:`Line styles example `. +For modifying the base line via the ``pen`` parameter, see the +:doc:`Line styles example `. +For details on the input data see the upstream GMT documentation +at https://docs.generic-mapping-tools.org/latest/plot.html#s + Also add link in example Line fronts Hybrid of fronts and quoted lines -Unclear `"+a"` does nothing, should change angle simliar to -quoted lines -Change base line via ``pen`` parameter, see the -:doc:`Line styles example `. -Also, custom symbols can be used, see -:doc:`Custom symbols example `. -For more modifications, see upstream GMT documentation at xyz -TODO - nice formulation +Unclear `"+a"` does nothing, should change angle see quoted lines """ From e37fc2472036b48ea2f98886e6e395768347997c Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 11 Jun 2023 20:34:46 +0200 Subject: [PATCH 10/19] Improve formulations, fix typos --- examples/gallery/lines/decoratedlines.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index 333c8887f27..e57f7264aa3 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -3,7 +3,7 @@ --------------- To draw a so-called *decorated line*, i.e., symbols along a line or curve, use the ``style`` parameter of the -:meth:`pygmt.Figure.plot` method with argument ``"~"`` with the +:meth:`pygmt.Figure.plot` method with the argument ``"~"`` and the desired modifiers. This example focuses on adjusting the symbols. Beside the build-in symbols also custom symbols can be used. There are similarities to so-called *fronts*, often used to plot @@ -12,7 +12,7 @@ For modifying the base line via the ``pen`` parameter, see the :doc:`Line styles example `. For details on the input data see the upstream GMT documentation -at https://docs.generic-mapping-tools.org/latest/plot.html#s +at https://docs.generic-mapping-tools.org/latest/plot.html#s. Also add link in example Line fronts Hybrid of fronts and quoted lines From 9dcc48958091951450f87ebf69a0a1a8ef0ef126 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 11 Jun 2023 22:59:44 +0200 Subject: [PATCH 11/19] Improve introduction text --- examples/gallery/lines/decoratedlines.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decoratedlines.py index e57f7264aa3..0a24f69ebc1 100644 --- a/examples/gallery/lines/decoratedlines.py +++ b/examples/gallery/lines/decoratedlines.py @@ -4,15 +4,16 @@ To draw a so-called *decorated line*, i.e., symbols along a line or curve, use the ``style`` parameter of the :meth:`pygmt.Figure.plot` method with the argument ``"~"`` and the -desired modifiers. This example focuses on adjusting the symbols. +desired modifiers. This example shows how to adjust the symbols. Beside the build-in symbols also custom symbols can be used. -There are similarities to so-called *fronts*, often used to plot -fault lines, subduction zones, or weather fronts; for details -see :doc:`Line styles example `. For modifying the base line via the ``pen`` parameter, see the :doc:`Line styles example `. For details on the input data see the upstream GMT documentation at https://docs.generic-mapping-tools.org/latest/plot.html#s. +Furthermore, there are so-called *line fronts*, which are often +used to plot fault lines, subduction zones, or weather fronts; +for details see +:doc:`Line fronts example `. Also add link in example Line fronts Hybrid of fronts and quoted lines From 7a1850f4bc6597980e181d943ae2e924f7e33e9c Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 27 Jun 2023 10:02:28 +0200 Subject: [PATCH 12/19] Rename file to 'decorated_lines.py' --- examples/gallery/lines/{decoratedlines.py => decorated_lines.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/gallery/lines/{decoratedlines.py => decorated_lines.py} (100%) diff --git a/examples/gallery/lines/decoratedlines.py b/examples/gallery/lines/decorated_lines.py similarity index 100% rename from examples/gallery/lines/decoratedlines.py rename to examples/gallery/lines/decorated_lines.py From 9e76406b49a034eb1ef0c7aaa624f9fb0268caf6 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 27 Jun 2023 10:08:25 +0200 Subject: [PATCH 13/19] Remove reminder comment --- examples/gallery/lines/decorated_lines.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index 0a24f69ebc1..3f126884b74 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -14,10 +14,6 @@ used to plot fault lines, subduction zones, or weather fronts; for details see :doc:`Line fronts example `. - -Also add link in example Line fronts -Hybrid of fronts and quoted lines -Unclear `"+a"` does nothing, should change angle see quoted lines """ From 9f0b80a626e6e33468a09977c02c327e0ef302b3 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 27 Jun 2023 10:56:14 +0200 Subject: [PATCH 14/19] Add missing word --- examples/gallery/lines/decorated_lines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index 3f126884b74..ebdefdf8513 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -12,7 +12,7 @@ at https://docs.generic-mapping-tools.org/latest/plot.html#s. Furthermore, there are so-called *line fronts*, which are often used to plot fault lines, subduction zones, or weather fronts; -for details see +for details see the :doc:`Line fronts example `. """ From 2ca85c70a1c3426374cb34c301896225c3268e0c Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 27 Jun 2023 11:01:51 +0200 Subject: [PATCH 15/19] Use 'dashed' instead of '-' --- examples/gallery/lines/decorated_lines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index ebdefdf8513..7f6335b06f6 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -38,7 +38,7 @@ "~d1c:+sc0.5c", # Adjust thickness, color, and style of the outline via "+p" # Here, we plot a 1-point thick, blue, dashed outline - "~d1c:+sc0.5c+p1p,blue,-", + "~d1c:+sc0.5c+p1p,blue,dashed", # Add a fill color using "+g" with the desired color "~d1c:+sc0.5c+glightblue", # To use a pattern as fill append "p" and give the pattern number From 250834f02d7b1eb51be6d7f53e02a4d01f1fab0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Thu, 29 Jun 2023 11:35:53 +0200 Subject: [PATCH 16/19] Write in a single line to reduce number of lines Co-authored-by: Dongdong Tian --- examples/gallery/lines/decorated_lines.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index 7f6335b06f6..7ae3b27e3a6 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -25,11 +25,7 @@ y = np.array([24, 24]) fig = pygmt.Figure() -fig.basemap( - region=[0, 10, 0, 24], - projection="X15c", - frame="+tDecorated Lines", -) +fig.basemap(region=[0, 10, 0, 24], projection="X15c", frame="+tDecorated Lines") # Plot different decorated lines for decoline in [ From 1e36581031485bb13d406081cf4dffb665692ff8 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 30 Jun 2023 10:21:54 +0200 Subject: [PATCH 17/19] Add explanation for colon --- examples/gallery/lines/decorated_lines.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index 7ae3b27e3a6..bee2c3f5f3d 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -4,7 +4,9 @@ To draw a so-called *decorated line*, i.e., symbols along a line or curve, use the ``style`` parameter of the :meth:`pygmt.Figure.plot` method with the argument ``"~"`` and the -desired modifiers. This example shows how to adjust the symbols. +desired modifiers. A colon (``":"``) is used to separate the +algorithm settings from the symbol information. + This example shows how to adjust the symbols. Beside the build-in symbols also custom symbols can be used. For modifying the base line via the ``pen`` parameter, see the :doc:`Line styles example `. From e9fa913991f2a773e8edc6606f8f7043087a8966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Sun, 2 Jul 2023 12:49:10 +0200 Subject: [PATCH 18/19] Fix typo (code review) Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> --- examples/gallery/lines/decorated_lines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index bee2c3f5f3d..566984e2410 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -7,7 +7,7 @@ desired modifiers. A colon (``":"``) is used to separate the algorithm settings from the symbol information. This example shows how to adjust the symbols. -Beside the build-in symbols also custom symbols can be used. +Beside the built-in symbols also custom symbols can be used. For modifying the base line via the ``pen`` parameter, see the :doc:`Line styles example `. For details on the input data see the upstream GMT documentation From d0d7c59463bf72d8f5736abfaadca701cec68825 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 2 Jul 2023 12:55:13 +0200 Subject: [PATCH 19/19] Use 'baseline' instead of 'base line' (code review) --- examples/gallery/lines/decorated_lines.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index 566984e2410..35b2bfa8681 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -6,9 +6,9 @@ :meth:`pygmt.Figure.plot` method with the argument ``"~"`` and the desired modifiers. A colon (``":"``) is used to separate the algorithm settings from the symbol information. - This example shows how to adjust the symbols. +This example shows how to adjust the symbols. Beside the built-in symbols also custom symbols can be used. -For modifying the base line via the ``pen`` parameter, see the +For modifying the baseline via the ``pen`` parameter, see the :doc:`Line styles example `. For details on the input data see the upstream GMT documentation at https://docs.generic-mapping-tools.org/latest/plot.html#s. @@ -49,13 +49,13 @@ # Line with squares ("s") with a size of 0.7 centimeters in a distance of # 1 centimeter "~d1c:+ss0.7c+gtan+p1p,black", - # Shift symbols using "+n" in x and y directions relative to the base line + # Shift symbols using "+n" in x and y directions relative to the baseline "~d1c:+sd0.5c+gtan+p1p,black+n-0.2c/0.1c", # Give the number of equally spaced symbols by using "n" instead of "d" "~n6:+sn0.5c+gtan+p1p,black", # Use upper-case "N" to have symbols at the start and end of the line "~N6:+sh0.5c+gtan+p1p,black", - # Suppress the base line by appending "+i" + # Suppress the baseline by appending "+i" "~d1c:+sg0.5c+gtan+p1p,black+i", # To only plot a symbol at the start of the line use "N-1" "~N-1:+sp0.2c+gblack",