From 176fcab8bf401e9b2f7fc6c37a7da6f9bef1f905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 29 Jul 2025 20:01:28 +0200 Subject: [PATCH 01/48] Add first ideas for Technical Reference page for justification codes --- doc/techref/index.md | 1 + doc/techref/justification_codes.md | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 doc/techref/justification_codes.md diff --git a/doc/techref/index.md b/doc/techref/index.md index 9d6367ac055..0380c229290 100644 --- a/doc/techref/index.md +++ b/doc/techref/index.md @@ -14,5 +14,6 @@ fonts.md text_formatting.md patterns.md encodings.md +justification_codes.md environment_variables.md ``` diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md new file mode 100755 index 00000000000..5b0ea9655f3 --- /dev/null +++ b/doc/techref/justification_codes.md @@ -0,0 +1,22 @@ +Justification codes +=================== + +To adjust the position of plot embellishments, such as scalbars, directional roses, +colorbars, legends, and images, user can adjust the *reference* and *anchor* points. + +Pass to `position` parameter and if already implemented `justify`. + +Reference point inside / outside of the map bounding box **j** / **J**. + +Anchor point **+j**. + +For both, specify a two-character (order independent) code. Choose from + +- Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) +- Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) + +Besides **j** / **J**, the reference point can be set based on + +- **g**: Map coordinates as *longitude*\/\ *latitude* +- **n**: Normalized bounding box coordinates as *nx*\/\ *ny* +- **x**: Plot coordinates as *x*\/\ *y* From 34d4409562b14bb6dfa84e59435852f89df630cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 29 Jul 2025 20:11:13 +0200 Subject: [PATCH 02/48] Remove execution permission --- doc/techref/justification_codes.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 doc/techref/justification_codes.md diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md old mode 100755 new mode 100644 From 9e493a257454b57be23a4f17ddfaacd6eeacbf63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 29 Jul 2025 21:59:16 +0200 Subject: [PATCH 03/48] Update --- doc/techref/justification_codes.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 5b0ea9655f3..58431711bd0 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -6,7 +6,8 @@ colorbars, legends, and images, user can adjust the *reference* and *anchor* poi Pass to `position` parameter and if already implemented `justify`. -Reference point inside / outside of the map bounding box **j** / **J**. +Reference point inside / outside of the map bounding box **j** (lower-case) / **J** +(upper-case), respectively. Anchor point **+j**. @@ -17,6 +18,6 @@ For both, specify a two-character (order independent) code. Choose from Besides **j** / **J**, the reference point can be set based on -- **g**: Map coordinates as *longitude*\/\ *latitude* -- **n**: Normalized bounding box coordinates as *nx*\/\ *ny* -- **x**: Plot coordinates as *x*\/\ *y* +- **g**: Map coordinates as *longitude*/*latitude* +- **n**: Normalized bounding box coordinates as *nx*/*ny* +- **x**: Plot coordinates as *x*/*y* From 2a222cf1c2da32f8ecfedf9c7a5d6cc65e0b294d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 30 Jul 2025 11:54:45 +0200 Subject: [PATCH 04/48] Focus on two-letter codes --- doc/techref/justification_codes.md | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 58431711bd0..c21208f38b5 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -1,23 +1,10 @@ Justification codes =================== -To adjust the position of plot embellishments, such as scalbars, directional roses, -colorbars, legends, and images, user can adjust the *reference* and *anchor* points. - -Pass to `position` parameter and if already implemented `justify`. - -Reference point inside / outside of the map bounding box **j** (lower-case) / **J** -(upper-case), respectively. - -Anchor point **+j**. - -For both, specify a two-character (order independent) code. Choose from +To adjust the position of plot embellishments, such as scalebars, directional roses, +colorbars, legends, and images, user can adjust the *reference* and *anchor* points +(see seperate TR page TODO). To set these points a two-character (order-independent) +code is used. Choose from - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) - -Besides **j** / **J**, the reference point can be set based on - -- **g**: Map coordinates as *longitude*/*latitude* -- **n**: Normalized bounding box coordinates as *nx*/*ny* -- **x**: Plot coordinates as *x*/*y* From e591ac235ae1aff1c6feb310793eb26617b89234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 30 Jul 2025 11:58:42 +0200 Subject: [PATCH 05/48] Adjust docs --- doc/techref/justification_codes.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index c21208f38b5..a94c6286d9d 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -2,9 +2,8 @@ Justification codes =================== To adjust the position of plot embellishments, such as scalebars, directional roses, -colorbars, legends, and images, user can adjust the *reference* and *anchor* points -(see seperate TR page TODO). To set these points a two-character (order-independent) -code is used. Choose from +colorbars, legends, and images, users can pass a two-character (order-independent) +code. Choose from - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) From 80c34004fb56cdb501af638e230fb4197814aa4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 15:35:16 +0200 Subject: [PATCH 06/48] Add code for sektch to explain justification codes --- doc/techref/justification_codes.md | 93 +++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index a94c6286d9d..4a894628351 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -1,5 +1,8 @@ -Justification codes -=================== +--- +file_format: mystnb +--- + +# Justification codes To adjust the position of plot embellishments, such as scalebars, directional roses, colorbars, legends, and images, users can pass a two-character (order-independent) @@ -7,3 +10,89 @@ code. Choose from - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) + + +```{code-cell} +--- +tags: [remove-input] +--- +""" +Script to generate sketches so visualize justification codes. +""" +import pygmt + +size = 5 +x = [-size, 0, size, size, size, 0, -size, -size, 0] +y = [-size, -size, -size, 0, size, size, size, 0, 0] +codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] + + +# %% +# ----------------------------------------------------------------------------- +fig = pygmt.Figure() +fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) + +fig.text( + font="15p,1,red", + x=x, + y=y, + text=codes, + justify=codes, + offset="j0.5c/0.5c+v2p,gray30", +) + +fig.plot(x=x, y=y, style="c0.3c", fill="lightred", no_clip=True) + +fig.text( + font="15p", + offset="j0.5c/0.5c", + no_clip=True, + x=[size, size, size, -size, 0, size], + y=[size, 0, -size, size, size, size], + justify=["ML", "ML", "ML", "BC", "BC", "BC"], + text=[ + "@%1%T@%%op", "@%1%M@%%iddle", "@%1%B@%%ottom", "@%1%L@%%eft", + "@%1%C@%%enter", "@%1%R@%%ight" + ], +) + +fig.show(width=600) + + +# %% +# ----------------------------------------------------------------------------- +fig = pygmt.Figure() +fig.basemap(projection="H10c", region="g", frame=0) + +for code in codes: + fig.text( + font="15p,1,red", + position=code, + justify=code, + text=code, + offset="j0.5c/0.5c+v2p,gray30", + ) + fig.text(font="10p,lightred", position=code, justify="MC", text="●", no_clip=True) + +fig.show(width=600) + + +# %% +# ----------------------------------------------------------------------------- +fig = pygmt.Figure() +fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0) + +fig.colorbar(cmap="navia", frame=0, position="jMC+w10c/2c+h") + +for code in codes: + fig.text( + font="10p,1,red", + position=code, + justify=code, + text=code, + offset="j0.3c/0.3c+v1p,gray30", + ) +fig.plot(x=x, y=y, style="c0.2c", fill="lightred", no_clip=True) + +fig.show(width=600) +``` From e8e2441db094573d156e06d230e1de8fe222da10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 16:39:30 +0200 Subject: [PATCH 07/48] Split script --- doc/techref/justification_codes.md | 36 ++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 4a894628351..2ab23dad721 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -26,9 +26,6 @@ x = [-size, 0, size, size, size, 0, -size, -size, 0] y = [-size, -size, -size, 0, size, size, size, 0, 0] codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] - -# %% -# ----------------------------------------------------------------------------- fig = pygmt.Figure() fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) @@ -57,10 +54,22 @@ fig.text( ) fig.show(width=600) +``` + + +Non-rectangular geographic basemap: +```{code-cell} +--- +tags: [remove-input] +--- +""" +Script to generate sketches so visualize justification codes for a non-rectangular geographic basemap. +""" +import pygmt + +codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] -# %% -# ----------------------------------------------------------------------------- fig = pygmt.Figure() fig.basemap(projection="H10c", region="g", frame=0) @@ -75,10 +84,23 @@ for code in codes: fig.text(font="10p,lightred", position=code, justify="MC", text="●", no_clip=True) fig.show(width=600) +``` + +Compasses, scalebars, legends, colorbars, text strings, etc. can also be abstracted by a rectangle. + +```{code-cell} +--- +tags: [remove-input] +--- +""" +Script to generate sketches so visualize justification code for a colorbar. +""" +import pygmt + +size = 5 +codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] -# %% -# ----------------------------------------------------------------------------- fig = pygmt.Figure() fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0) From 14234fc01d85e514901e6e52152996ecdc52a489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 19:55:22 +0200 Subject: [PATCH 08/48] Add sketch for reference and anchor point --- doc/techref/justification_codes.md | 62 +++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 2ab23dad721..e078cfa3d8c 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -30,7 +30,7 @@ fig = pygmt.Figure() fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) fig.text( - font="15p,1,red", + font="15p,1,black", x=x, y=y, text=codes, @@ -38,7 +38,7 @@ fig.text( offset="j0.5c/0.5c+v2p,gray30", ) -fig.plot(x=x, y=y, style="c0.3c", fill="lightred", no_clip=True) +fig.plot(x=x, y=y, style="c0.3c", fill="steelblue", no_clip=True) fig.text( font="15p", @@ -75,13 +75,13 @@ fig.basemap(projection="H10c", region="g", frame=0) for code in codes: fig.text( - font="15p,1,red", + font="15p,1,black", position=code, justify=code, text=code, offset="j0.5c/0.5c+v2p,gray30", ) - fig.text(font="10p,lightred", position=code, justify="MC", text="●", no_clip=True) + fig.text(font="10p,steelblue", position=code, justify="MC", text="●", no_clip=True) fig.show(width=600) ``` @@ -108,13 +108,63 @@ fig.colorbar(cmap="navia", frame=0, position="jMC+w10c/2c+h") for code in codes: fig.text( - font="10p,1,red", + font="10p,1,black", position=code, justify=code, text=code, offset="j0.3c/0.3c+v1p,gray30", ) -fig.plot(x=x, y=y, style="c0.2c", fill="lightred", no_clip=True) +fig.plot(x=x, y=y, style="c0.2c", fill="steelblue", no_clip=True) + +fig.show(width=600) +``` + + +Reference and anchor points: + + +```{code-cell} +--- +tags: [remove-input] +--- +""" +Reference and anchor points. +""" +import pygmt + +size = 5 +x1 = [-size, 0, size, size, size, 0, -size, -size, 0] +y1 = [-size, -size, -size, 0, size, size, size, 0, 0] +codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] +x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] +y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] + +fig = pygmt.Figure() +fig.basemap(projection="X12c/6c", region=[-size, size, -size, size], frame=0) + +fig.text( + text=codes, + x=x1, + y=y1, + justify=codes, + offset="j0.5c/0.25c+v1p,gray30", + font="10p,1,black", +) + +fig.plot(x=x2[0:-1], y=y2[0:-1], fill="bisque") + +fig.plot(x=-size, y=size, style="s0.6c", fill="lightred", no_clip=True) +fig.plot(x=x1, y=y1, style="c0.25c", fill="steelblue", no_clip=True) + +fig.plot(x=-3, y=1, style="s0.6c", fill="orange") +fig.plot(x=x2, y=y2, style="c0.15c", fill="darkblue") + +fig.plot(x=[-5, -3], y=[5, 1], pen="0.5p,black") +fig.plot(x=[-5, -3], y=[1, 1], pen="0.5p,black,2_2") +fig.plot(x=[-3, -3], y=[1, 5], pen="0.5p,black,2_2") + +fig.text(x=-4, y=1, text="dx", offset="0c/0.2c") +fig.text(x=-3, y=3, text="dy", offset="-0.2c/0c") fig.show(width=600) ``` From b119946218afab57300d4f6debe0849046d37454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 19:59:44 +0200 Subject: [PATCH 09/48] Adjust cmap for better contrast --- doc/techref/justification_codes.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index e078cfa3d8c..b54907647f9 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -104,7 +104,7 @@ codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] fig = pygmt.Figure() fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0) -fig.colorbar(cmap="navia", frame=0, position="jMC+w10c/2c+h") +fig.colorbar(cmap="acton", frame=0, position="jMC+w10c/2c+h") for code in codes: fig.text( @@ -122,7 +122,6 @@ fig.show(width=600) Reference and anchor points: - ```{code-cell} --- tags: [remove-input] From 06fadaee1d5918f1da57563a1bfd9ad082f633bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 20:15:00 +0200 Subject: [PATCH 10/48] Adjust cmap for better contrast --- doc/techref/justification_codes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index b54907647f9..26b2fa92294 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -104,7 +104,7 @@ codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] fig = pygmt.Figure() fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0) -fig.colorbar(cmap="acton", frame=0, position="jMC+w10c/2c+h") +fig.colorbar(cmap="hawaii", frame=0, position="jMC+w10c/2c+h") for code in codes: fig.text( From 5bd36a3dd2171953862abd1846534f36a21e8ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 20:25:23 +0200 Subject: [PATCH 11/48] Adjust font size --- doc/techref/justification_codes.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 26b2fa92294..3be1aefcd9d 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -75,7 +75,7 @@ fig.basemap(projection="H10c", region="g", frame=0) for code in codes: fig.text( - font="15p,1,black", + font="10p,1,black", position=code, justify=code, text=code, @@ -112,7 +112,7 @@ for code in codes: position=code, justify=code, text=code, - offset="j0.3c/0.3c+v1p,gray30", + offset="j0.3c/0.15c+v1p,gray30", ) fig.plot(x=x, y=y, style="c0.2c", fill="steelblue", no_clip=True) @@ -146,7 +146,7 @@ fig.text( x=x1, y=y1, justify=codes, - offset="j0.5c/0.25c+v1p,gray30", + offset="j0.5c/0.2c+v1p,gray30", font="10p,1,black", ) From 839054bdbfc01a5140567d0960c55790e11ef8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 20:30:59 +0200 Subject: [PATCH 12/48] No equal offsets in x and y directions --- doc/techref/justification_codes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 3be1aefcd9d..189f4f644aa 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -139,7 +139,7 @@ x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] fig = pygmt.Figure() -fig.basemap(projection="X12c/6c", region=[-size, size, -size, size], frame=0) +fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) fig.text( text=codes, From 4267fe37778a1b1f4878a437ea00289fa47cd790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 1 Aug 2025 20:40:00 +0200 Subject: [PATCH 13/48] Use consistent order in justification codes --- doc/techref/justification_codes.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 189f4f644aa..07dbdf90967 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -24,7 +24,7 @@ import pygmt size = 5 x = [-size, 0, size, size, size, 0, -size, -size, 0] y = [-size, -size, -size, 0, size, size, size, 0, 0] -codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] +codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] fig = pygmt.Figure() fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) @@ -48,8 +48,8 @@ fig.text( y=[size, 0, -size, size, size, size], justify=["ML", "ML", "ML", "BC", "BC", "BC"], text=[ - "@%1%T@%%op", "@%1%M@%%iddle", "@%1%B@%%ottom", "@%1%L@%%eft", - "@%1%C@%%enter", "@%1%R@%%ight" + "@%1%T@%%op", "@%1%M@%%iddle", "@%1%B@%%ottom", + "@%1%L@%%eft", "@%1%C@%%enter", "@%1%R@%%ight" ], ) @@ -68,7 +68,7 @@ Script to generate sketches so visualize justification codes for a non-rectangul """ import pygmt -codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] +codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] fig = pygmt.Figure() fig.basemap(projection="H10c", region="g", frame=0) @@ -99,7 +99,7 @@ Script to generate sketches so visualize justification code for a colorbar. import pygmt size = 5 -codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] +codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] fig = pygmt.Figure() fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0) @@ -134,7 +134,7 @@ import pygmt size = 5 x1 = [-size, 0, size, size, size, 0, -size, -size, 0] y1 = [-size, -size, -size, 0, size, size, size, 0, 0] -codes = ["BL","BC", "BR", "MR", "TR", "CT", "LT", "LM", "MC"] +codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] From b59e858c20e1ca538df9cc8177bbe61a2710e54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sat, 2 Aug 2025 14:53:49 +0200 Subject: [PATCH 14/48] Improve docs --- doc/techref/justification_codes.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 07dbdf90967..cf54b5eee07 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -17,7 +17,7 @@ code. Choose from tags: [remove-input] --- """ -Script to generate sketches so visualize justification codes. +Script showing the justification codes used in GMT / PyGMT. """ import pygmt @@ -64,7 +64,7 @@ Non-rectangular geographic basemap: tags: [remove-input] --- """ -Script to generate sketches so visualize justification codes for a non-rectangular geographic basemap. +Script showing justification codes for non-rectangular geographic basemaps. """ import pygmt @@ -94,7 +94,7 @@ Compasses, scalebars, legends, colorbars, text strings, etc. can also be abstrac tags: [remove-input] --- """ -Script to generate sketches so visualize justification code for a colorbar. +Script showing justification codes for plot embellishments, e.g., a colorbar. """ import pygmt @@ -127,7 +127,7 @@ Reference and anchor points: tags: [remove-input] --- """ -Reference and anchor points. +Script explaining reference and anchor points. """ import pygmt From 29e07bdd0a1bd3d927a8a94b8942774dc41cf0ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sat, 2 Aug 2025 22:04:28 +0200 Subject: [PATCH 15/48] Try defining variables ones --- doc/techref/justification_codes.md | 40 +++++++++++------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index cf54b5eee07..45ea17ffa8c 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -22,8 +22,10 @@ Script showing the justification codes used in GMT / PyGMT. import pygmt size = 5 -x = [-size, 0, size, size, size, 0, -size, -size, 0] -y = [-size, -size, -size, 0, size, size, size, 0, 0] +x1 = [-size, 0, size, size, size, 0, -size, -size, 0] +y1 = [-size, -size, -size, 0, size, size, size, 0, 0] +x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] +y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] fig = pygmt.Figure() @@ -31,14 +33,14 @@ fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) fig.text( font="15p,1,black", - x=x, - y=y, + x=x1, + y=y1, text=codes, justify=codes, offset="j0.5c/0.5c+v2p,gray30", ) -fig.plot(x=x, y=y, style="c0.3c", fill="steelblue", no_clip=True) +fig.plot(x=x1, y=y1, style="c0.3c", fill="steelblue", no_clip=True) fig.text( font="15p", @@ -48,8 +50,12 @@ fig.text( y=[size, 0, -size, size, size, size], justify=["ML", "ML", "ML", "BC", "BC", "BC"], text=[ - "@%1%T@%%op", "@%1%M@%%iddle", "@%1%B@%%ottom", - "@%1%L@%%eft", "@%1%C@%%enter", "@%1%R@%%ight" + "@%1%T@%%op", + "@%1%M@%%iddle", + "@%1%B@%%ottom", + "@%1%L@%%eft", + "@%1%C@%%enter", + "@%1%R@%%ight", ], ) @@ -66,10 +72,6 @@ tags: [remove-input] """ Script showing justification codes for non-rectangular geographic basemaps. """ -import pygmt - -codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] - fig = pygmt.Figure() fig.basemap(projection="H10c", region="g", frame=0) @@ -96,11 +98,6 @@ tags: [remove-input] """ Script showing justification codes for plot embellishments, e.g., a colorbar. """ -import pygmt - -size = 5 -codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] - fig = pygmt.Figure() fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0) @@ -114,7 +111,7 @@ for code in codes: text=code, offset="j0.3c/0.15c+v1p,gray30", ) -fig.plot(x=x, y=y, style="c0.2c", fill="steelblue", no_clip=True) +fig.plot(x=x1, y=y1, style="c0.2c", fill="steelblue", no_clip=True) fig.show(width=600) ``` @@ -129,15 +126,6 @@ tags: [remove-input] """ Script explaining reference and anchor points. """ -import pygmt - -size = 5 -x1 = [-size, 0, size, size, size, 0, -size, -size, 0] -y1 = [-size, -size, -size, 0, size, size, size, 0, 0] -codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] -x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] -y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] - fig = pygmt.Figure() fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) From 0303e69bd28839bd666b03701e1a6570674fb211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 4 Aug 2025 20:01:48 +0200 Subject: [PATCH 16/48] Add docs --- doc/techref/justification_codes.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 45ea17ffa8c..9820295c66e 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -11,6 +11,7 @@ code. Choose from - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) +The possible nine justification codes are visualized in the sketch below: ```{code-cell} --- @@ -62,8 +63,8 @@ fig.text( fig.show(width=600) ``` - -Non-rectangular geographic basemap: +For a non-rectangular geographic basemap the justification codes refer to the plot or map +bounding box: ```{code-cell} --- @@ -89,7 +90,9 @@ fig.show(width=600) ``` -Compasses, scalebars, legends, colorbars, text strings, etc. can also be abstracted by a rectangle. +Plot embellishments such as scalebars, directional roses, legends, colorbars as well +as text strings can also be abstracted as rectangles. The justification codes are +shown exemplary for a colorbar. ```{code-cell} --- From e1656bbd54f040c52a193caca48ffc1bffff1955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 4 Aug 2025 20:07:01 +0200 Subject: [PATCH 17/48] Move content for reference and anchor point to seperate file --- doc/techref/justification_codes.md | 40 ----------------------- doc/techref/reference_anchor_points.md | 44 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 40 deletions(-) create mode 100755 doc/techref/reference_anchor_points.md diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 9820295c66e..0c286881256 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -118,43 +118,3 @@ fig.plot(x=x1, y=y1, style="c0.2c", fill="steelblue", no_clip=True) fig.show(width=600) ``` - - -Reference and anchor points: - -```{code-cell} ---- -tags: [remove-input] ---- -""" -Script explaining reference and anchor points. -""" -fig = pygmt.Figure() -fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) - -fig.text( - text=codes, - x=x1, - y=y1, - justify=codes, - offset="j0.5c/0.2c+v1p,gray30", - font="10p,1,black", -) - -fig.plot(x=x2[0:-1], y=y2[0:-1], fill="bisque") - -fig.plot(x=-size, y=size, style="s0.6c", fill="lightred", no_clip=True) -fig.plot(x=x1, y=y1, style="c0.25c", fill="steelblue", no_clip=True) - -fig.plot(x=-3, y=1, style="s0.6c", fill="orange") -fig.plot(x=x2, y=y2, style="c0.15c", fill="darkblue") - -fig.plot(x=[-5, -3], y=[5, 1], pen="0.5p,black") -fig.plot(x=[-5, -3], y=[1, 1], pen="0.5p,black,2_2") -fig.plot(x=[-3, -3], y=[1, 5], pen="0.5p,black,2_2") - -fig.text(x=-4, y=1, text="dx", offset="0c/0.2c") -fig.text(x=-3, y=3, text="dy", offset="-0.2c/0c") - -fig.show(width=600) -``` diff --git a/doc/techref/reference_anchor_points.md b/doc/techref/reference_anchor_points.md new file mode 100755 index 00000000000..57e849b6bb8 --- /dev/null +++ b/doc/techref/reference_anchor_points.md @@ -0,0 +1,44 @@ +--- +file_format: mystnb +--- + +# Reference and anchor points + +xxx + +```{code-cell} +--- +tags: [remove-input] +--- +""" +Script explaining reference and anchor points. +""" +fig = pygmt.Figure() +fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) + +fig.text( + text=codes, + x=x1, + y=y1, + justify=codes, + offset="j0.5c/0.2c+v1p,gray30", + font="10p,1,black", +) + +fig.plot(x=x2[0:-1], y=y2[0:-1], fill="bisque") + +fig.plot(x=-size, y=size, style="s0.6c", fill="lightred", no_clip=True) +fig.plot(x=x1, y=y1, style="c0.25c", fill="steelblue", no_clip=True) + +fig.plot(x=-3, y=1, style="s0.6c", fill="orange") +fig.plot(x=x2, y=y2, style="c0.15c", fill="darkblue") + +fig.plot(x=[-5, -3], y=[5, 1], pen="0.5p,black") +fig.plot(x=[-5, -3], y=[1, 1], pen="0.5p,black,2_2") +fig.plot(x=[-3, -3], y=[1, 5], pen="0.5p,black,2_2") + +fig.text(x=-4, y=1, text="dx", offset="0c/0.2c") +fig.text(x=-3, y=3, text="dy", offset="-0.2c/0c") + +fig.show(width=600) +``` From c5cf5a8b82feccda32afd6342d3326f8f46b867d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 4 Aug 2025 20:07:56 +0200 Subject: [PATCH 18/48] Update index --- doc/techref/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/techref/index.md b/doc/techref/index.md index 0380c229290..ce8b504bb61 100644 --- a/doc/techref/index.md +++ b/doc/techref/index.md @@ -15,5 +15,6 @@ text_formatting.md patterns.md encodings.md justification_codes.md +reference_anchor_points.md environment_variables.md ``` From b7076a7f50483094e128470cca9e63ac77168d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 4 Aug 2025 20:14:08 +0200 Subject: [PATCH 19/48] Add import and variable definitions --- doc/techref/reference_anchor_points.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/techref/reference_anchor_points.md b/doc/techref/reference_anchor_points.md index 57e849b6bb8..b9e01b9b96d 100755 --- a/doc/techref/reference_anchor_points.md +++ b/doc/techref/reference_anchor_points.md @@ -13,6 +13,15 @@ tags: [remove-input] """ Script explaining reference and anchor points. """ +import pygmt + +size = 5 +x1 = [-size, 0, size, size, size, 0, -size, -size, 0] +y1 = [-size, -size, -size, 0, size, size, size, 0, 0] +x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] +y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] +codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] + fig = pygmt.Figure() fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) From 6bc33897ca25799b74d05169fcad88b4636a594c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 6 Aug 2025 19:50:51 +0200 Subject: [PATCH 20/48] Use Unix LF --- doc/techref/reference_anchor_points.md | 106 ++++++++++++------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/doc/techref/reference_anchor_points.md b/doc/techref/reference_anchor_points.md index b9e01b9b96d..c282f7155a6 100755 --- a/doc/techref/reference_anchor_points.md +++ b/doc/techref/reference_anchor_points.md @@ -1,53 +1,53 @@ ---- -file_format: mystnb ---- - -# Reference and anchor points - -xxx - -```{code-cell} ---- -tags: [remove-input] ---- -""" -Script explaining reference and anchor points. -""" -import pygmt - -size = 5 -x1 = [-size, 0, size, size, size, 0, -size, -size, 0] -y1 = [-size, -size, -size, 0, size, size, size, 0, 0] -x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] -y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] -codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] - -fig = pygmt.Figure() -fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) - -fig.text( - text=codes, - x=x1, - y=y1, - justify=codes, - offset="j0.5c/0.2c+v1p,gray30", - font="10p,1,black", -) - -fig.plot(x=x2[0:-1], y=y2[0:-1], fill="bisque") - -fig.plot(x=-size, y=size, style="s0.6c", fill="lightred", no_clip=True) -fig.plot(x=x1, y=y1, style="c0.25c", fill="steelblue", no_clip=True) - -fig.plot(x=-3, y=1, style="s0.6c", fill="orange") -fig.plot(x=x2, y=y2, style="c0.15c", fill="darkblue") - -fig.plot(x=[-5, -3], y=[5, 1], pen="0.5p,black") -fig.plot(x=[-5, -3], y=[1, 1], pen="0.5p,black,2_2") -fig.plot(x=[-3, -3], y=[1, 5], pen="0.5p,black,2_2") - -fig.text(x=-4, y=1, text="dx", offset="0c/0.2c") -fig.text(x=-3, y=3, text="dy", offset="-0.2c/0c") - -fig.show(width=600) -``` +--- +file_format: mystnb +--- + +# Reference and anchor points + +xxx + +```{code-cell} +--- +tags: [remove-input] +--- +""" +Script explaining reference and anchor points. +""" +import pygmt + +size = 5 +x1 = [-size, 0, size, size, size, 0, -size, -size, 0] +y1 = [-size, -size, -size, 0, size, size, size, 0, 0] +x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] +y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] +codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] + +fig = pygmt.Figure() +fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) + +fig.text( + text=codes, + x=x1, + y=y1, + justify=codes, + offset="j0.5c/0.2c+v1p,gray30", + font="10p,1,black", +) + +fig.plot(x=x2[0:-1], y=y2[0:-1], fill="bisque") + +fig.plot(x=-size, y=size, style="s0.6c", fill="lightred", no_clip=True) +fig.plot(x=x1, y=y1, style="c0.25c", fill="steelblue", no_clip=True) + +fig.plot(x=-3, y=1, style="s0.6c", fill="orange") +fig.plot(x=x2, y=y2, style="c0.15c", fill="darkblue") + +fig.plot(x=[-5, -3], y=[5, 1], pen="0.5p,black") +fig.plot(x=[-5, -3], y=[1, 1], pen="0.5p,black,2_2") +fig.plot(x=[-3, -3], y=[1, 5], pen="0.5p,black,2_2") + +fig.text(x=-4, y=1, text="dx", offset="0c/0.2c") +fig.text(x=-3, y=3, text="dy", offset="-0.2c/0c") + +fig.show(width=600) +``` From 0ce44f87300c5419862add3253a88c041e59f22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 6 Aug 2025 19:55:24 +0200 Subject: [PATCH 21/48] Remove execution permission --- doc/techref/reference_anchor_points.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 doc/techref/reference_anchor_points.md diff --git a/doc/techref/reference_anchor_points.md b/doc/techref/reference_anchor_points.md old mode 100755 new mode 100644 From 786b014baa88e9c5ec205acfc96e026d347217eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sun, 10 Aug 2025 12:02:49 +0200 Subject: [PATCH 22/48] Adjust colormap --- doc/techref/justification_codes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 0c286881256..807ee662008 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -104,7 +104,7 @@ Script showing justification codes for plot embellishments, e.g., a colorbar. fig = pygmt.Figure() fig.basemap(projection="X10c/2c", region=[-size, size, -size, size], frame=0) -fig.colorbar(cmap="hawaii", frame=0, position="jMC+w10c/2c+h") +fig.colorbar(cmap="buda", frame=0, position="jMC+w10c/2c+h") for code in codes: fig.text( From 873a1ba09a93dbd84bd840dfb467b2cae567c749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Sun, 10 Aug 2025 20:04:50 +0200 Subject: [PATCH 23/48] Remove reference anchor points content --- doc/techref/index.md | 1 - doc/techref/reference_anchor_points.md | 53 -------------------------- 2 files changed, 54 deletions(-) delete mode 100644 doc/techref/reference_anchor_points.md diff --git a/doc/techref/index.md b/doc/techref/index.md index ce8b504bb61..0380c229290 100644 --- a/doc/techref/index.md +++ b/doc/techref/index.md @@ -15,6 +15,5 @@ text_formatting.md patterns.md encodings.md justification_codes.md -reference_anchor_points.md environment_variables.md ``` diff --git a/doc/techref/reference_anchor_points.md b/doc/techref/reference_anchor_points.md deleted file mode 100644 index c282f7155a6..00000000000 --- a/doc/techref/reference_anchor_points.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -file_format: mystnb ---- - -# Reference and anchor points - -xxx - -```{code-cell} ---- -tags: [remove-input] ---- -""" -Script explaining reference and anchor points. -""" -import pygmt - -size = 5 -x1 = [-size, 0, size, size, size, 0, -size, -size, 0] -y1 = [-size, -size, -size, 0, size, size, size, 0, 0] -x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] -y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] -codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] - -fig = pygmt.Figure() -fig.basemap(projection="X10c/6c", region=[-size, size, -size, size], frame=0) - -fig.text( - text=codes, - x=x1, - y=y1, - justify=codes, - offset="j0.5c/0.2c+v1p,gray30", - font="10p,1,black", -) - -fig.plot(x=x2[0:-1], y=y2[0:-1], fill="bisque") - -fig.plot(x=-size, y=size, style="s0.6c", fill="lightred", no_clip=True) -fig.plot(x=x1, y=y1, style="c0.25c", fill="steelblue", no_clip=True) - -fig.plot(x=-3, y=1, style="s0.6c", fill="orange") -fig.plot(x=x2, y=y2, style="c0.15c", fill="darkblue") - -fig.plot(x=[-5, -3], y=[5, 1], pen="0.5p,black") -fig.plot(x=[-5, -3], y=[1, 1], pen="0.5p,black,2_2") -fig.plot(x=[-3, -3], y=[1, 5], pen="0.5p,black,2_2") - -fig.text(x=-4, y=1, text="dx", offset="0c/0.2c") -fig.text(x=-3, y=3, text="dy", offset="-0.2c/0c") - -fig.show(width=600) -``` From 4233f320a8dd4482b2d74e46319684136647522a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 13 Aug 2025 21:09:38 +0200 Subject: [PATCH 24/48] Remove unneeded variables --- doc/techref/justification_codes.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 807ee662008..f5152cb3f04 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -25,8 +25,6 @@ import pygmt size = 5 x1 = [-size, 0, size, size, size, 0, -size, -size, 0] y1 = [-size, -size, -size, 0, size, size, size, 0, 0] -x2 = [-3, -2, -1, -1, -1, -2, -3, -3, -2] -y2 = [-1, -1, -1, 0, 1, 1, 1, 0, 0] codes = ["BL", "BC", "BR", "MR", "TR", "TC", "TL", "ML", "MC"] fig = pygmt.Figure() From d827aec33f34a8ef4db1f09b322d95ef014f9e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 13 Aug 2025 21:13:13 +0200 Subject: [PATCH 25/48] Adjust docs --- doc/techref/justification_codes.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index f5152cb3f04..284b716521c 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -5,7 +5,7 @@ file_format: mystnb # Justification codes To adjust the position of plot embellishments, such as scalebars, directional roses, -colorbars, legends, and images, users can pass a two-character (order-independent) +colorbars, legends, text, and images, users can pass a two-character (order-independent) code. Choose from - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) @@ -61,7 +61,7 @@ fig.text( fig.show(width=600) ``` -For a non-rectangular geographic basemap the justification codes refer to the plot or map +For a non-rectangular geographic basemap, the justification codes refer to the map bounding box: ```{code-cell} @@ -88,8 +88,7 @@ fig.show(width=600) ``` -Plot embellishments such as scalebars, directional roses, legends, colorbars as well -as text strings can also be abstracted as rectangles. The justification codes are +Plot embellishments can be abstracted as rectangles. Here, the justification codes are shown exemplary for a colorbar. ```{code-cell} From 04f7fccf3d2a83f7d43a8696eed5be3a82ebcc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 20 Aug 2025 10:45:48 +0200 Subject: [PATCH 26/48] TEST: list for alias needs at least two enteries --- pygmt/src/grdcut.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index 0b8d2d766bc..2ebf5bb96e3 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -53,6 +53,7 @@ def grdcut( {aliases} - J = projection + - R = region Parameters ---------- From a39d10dbfa9295283777b4f4869306813e9033aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 20 Aug 2025 12:16:25 +0200 Subject: [PATCH 27/48] TEST: Revert --- pygmt/src/grdcut.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index 2ebf5bb96e3..0b8d2d766bc 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -53,7 +53,6 @@ def grdcut( {aliases} - J = projection - - R = region Parameters ---------- From c1b9227b348258a48c2988dba6698857190f6030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 20 Aug 2025 12:17:34 +0200 Subject: [PATCH 28/48] TEST: Copy list from coast method --- pygmt/src/grdcut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/grdcut.py b/pygmt/src/grdcut.py index 0b8d2d766bc..7428b616624 100644 --- a/pygmt/src/grdcut.py +++ b/pygmt/src/grdcut.py @@ -52,7 +52,7 @@ def grdcut( Full GMT docs at :gmt-docs:`grdcut.html`. {aliases} - - J = projection + - J = projection Parameters ---------- From c00369ba8b724dd93d9bf99ad5f90c4d4ef8ac28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 22 Aug 2025 19:59:33 +0200 Subject: [PATCH 29/48] Improve docs --- doc/techref/justification_codes.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 284b716521c..28c67d983ae 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -4,9 +4,12 @@ file_format: mystnb # Justification codes -To adjust the position of plot embellishments, such as scalebars, directional roses, -colorbars, legends, text, and images, users can pass a two-character (order-independent) -code. Choose from +To place plot embellishments, such as scalebars, directional roses, colorbars, +legends, text, and images on a figure two points have to be specified: a point +somewhere on the figure (reference point) and a point on the feature (anchor +point). For both, users can use a two-character (order-independent) code, to +give the vertical and horizontal position: + - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) From fe324a49272149b91d5e0fb65cbe08159983bc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 22 Aug 2025 20:03:36 +0200 Subject: [PATCH 30/48] Update formulation --- doc/techref/justification_codes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 28c67d983ae..785362ca8ab 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -7,8 +7,8 @@ file_format: mystnb To place plot embellishments, such as scalebars, directional roses, colorbars, legends, text, and images on a figure two points have to be specified: a point somewhere on the figure (reference point) and a point on the feature (anchor -point). For both, users can use a two-character (order-independent) code, to -give the vertical and horizontal position: +point). For both, users can use a two-character (order-independent) code, a +combination of a vertical code and a horizontal code: - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) From 16e7a40991b00204d3d2e6baf0c3940e35b3b5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 22 Aug 2025 20:19:46 +0200 Subject: [PATCH 31/48] TEST: remove gallery example linestrings --- examples/gallery/lines/linestrings.py | 46 --------------------------- 1 file changed, 46 deletions(-) delete mode 100644 examples/gallery/lines/linestrings.py diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py deleted file mode 100644 index 18f94502f16..00000000000 --- a/examples/gallery/lines/linestrings.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -GeoPandas: Plotting lines with LineString or MultiLineString geometry -===================================================================== - -The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such as lines -with LineString or MultiLineString geometry types stored in a -:class:`geopandas.GeoDataFrame` object or any object that implements the -`__geo_interface__ `__ property. - -Use :func:`geopandas.read_file` to load data from any supported OGR format such as a -shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. Then, pass the -:class:`geopandas.GeoDataFrame` object as an argument to the ``data`` parameter of -:meth:`pygmt.Figure.plot`, and style the lines using the ``pen`` parameter. -""" - -# %% -import geodatasets -import geopandas as gpd -import pygmt - -# Read a sample dataset provided by the geodatasets package. -# The dataset contains large rivers in Europe, stored as LineString/MultiLineString -# geometry types. -gdf = gpd.read_file(geodatasets.get_path("eea large_rivers")) - -# Convert object to EPSG 4326 coordinate system -gdf = gdf.to_crs("EPSG:4326") -gdf.head() - -# %% -fig = pygmt.Figure() - -fig.coast( - projection="M10c", - region=[-10, 30, 35, 57], - resolution="l", - land="gray95", - shorelines="1/0.1p,gray50", - borders="1/0.1,gray30", - frame=True, -) - -# Add rivers to map -fig.plot(data=gdf, pen="1p,steelblue") - -fig.show() From 4f7218992a50ef1ac3da6363b71148529782245e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Fri, 22 Aug 2025 20:43:37 +0200 Subject: [PATCH 32/48] Revert "TEST: remove gallery example linestrings" This reverts commit 16e7a40991b00204d3d2e6baf0c3940e35b3b5f6. --- examples/gallery/lines/linestrings.py | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 examples/gallery/lines/linestrings.py diff --git a/examples/gallery/lines/linestrings.py b/examples/gallery/lines/linestrings.py new file mode 100644 index 00000000000..18f94502f16 --- /dev/null +++ b/examples/gallery/lines/linestrings.py @@ -0,0 +1,46 @@ +""" +GeoPandas: Plotting lines with LineString or MultiLineString geometry +===================================================================== + +The :meth:`pygmt.Figure.plot` method allows us to plot geographical data such as lines +with LineString or MultiLineString geometry types stored in a +:class:`geopandas.GeoDataFrame` object or any object that implements the +`__geo_interface__ `__ property. + +Use :func:`geopandas.read_file` to load data from any supported OGR format such as a +shapefile (.shp), GeoJSON (.geojson), geopackage (.gpkg), etc. Then, pass the +:class:`geopandas.GeoDataFrame` object as an argument to the ``data`` parameter of +:meth:`pygmt.Figure.plot`, and style the lines using the ``pen`` parameter. +""" + +# %% +import geodatasets +import geopandas as gpd +import pygmt + +# Read a sample dataset provided by the geodatasets package. +# The dataset contains large rivers in Europe, stored as LineString/MultiLineString +# geometry types. +gdf = gpd.read_file(geodatasets.get_path("eea large_rivers")) + +# Convert object to EPSG 4326 coordinate system +gdf = gdf.to_crs("EPSG:4326") +gdf.head() + +# %% +fig = pygmt.Figure() + +fig.coast( + projection="M10c", + region=[-10, 30, 35, 57], + resolution="l", + land="gray95", + shorelines="1/0.1p,gray50", + borders="1/0.1,gray30", + frame=True, +) + +# Add rivers to map +fig.plot(data=gdf, pen="1p,steelblue") + +fig.show() From 239036fa730a5b8d61019a9cf1c7020a2076a75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 25 Aug 2025 21:26:42 +0200 Subject: [PATCH 33/48] Link to techref in docs --- pygmt/src/colorbar.py | 10 ++++++---- pygmt/src/inset.py | 8 +++++--- pygmt/src/text.py | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 97018f836de..1b0be7c631f 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -68,8 +68,9 @@ def colorbar( [**+n**\ [*txt*]][**+o**\ *dx*\ [/*dy*]]. Define the reference point on the map for the color scale using one of four coordinate systems: (1) Use **g** for map (user) coordinates, (2) - use **j** or **J** for setting *refpoint* via a 2-character - justification code that refers to the (invisible) map domain rectangle, + use **j** or **J** for setting *refpoint* via a + :doc:`2-character justification code ` + that refers to the (invisible) map domain rectangle, (3) use **n** for normalized (0-1) coordinates, or (4) use **x** for plot coordinates (inches, cm, etc.). All but **x** requires both ``region`` and ``projection`` to be specified. Append **+w** followed @@ -78,8 +79,9 @@ def colorbar( reverse the scale bar. Append **+h** to get a horizontal scale [Default is vertical (**+v**)]. By default, the anchor point on the scale is assumed to be the bottom left corner (**BL**), but this can - be changed by appending **+j** followed by a 2-character - justification code *justify*. + be changed by appending **+j** followed by a + :doc:`2-character justification code ` + *justify*. box : bool or str [**+c**\ *clearances*][**+g**\ *fill*][**+i**\ [[*gap*/]\ *pen*]]\ [**+p**\ [*pen*]][**+r**\ [*radius*]][**+s**\ [[*dx*/*dy*/][*shade*]]]. diff --git a/pygmt/src/inset.py b/pygmt/src/inset.py index ef9fe5aeca4..ad0195875e8 100644 --- a/pygmt/src/inset.py +++ b/pygmt/src/inset.py @@ -56,7 +56,8 @@ def inset( Append **g**\ *lon*/*lat* for map (user) coordinates, **j**\ *code* or **J**\ *code* for setting the *refpoint* via a - 2-character justification code that refers to the (invisible) + :doc:`2-character justification code ` + that refers to the (invisible) projected map bounding box, **n**\ *xn*/*yn* for normalized (0-1) bounding box coordinates, or **x**\ *x*/*y* for plot coordinates (inches, centimeters, points, append unit). @@ -75,8 +76,9 @@ def inset( Append **+w**\ *width*\ [/*height*] of bounding rectangle or box in plot coordinates (inches, centimeters, etc.). By default, the anchor point on the scale is assumed to be the bottom left corner - (**BL**), but this can be changed by appending **+j** followed by - a 2-character justification code *justify*. + (**BL**), but this can be changed by appending **+j** followed by a + :doc:`2-character justification code ` + *justify*. **Note**: If **j** is used then *justify* defaults to the same as *refpoint*, if **J** is used then *justify* defaults to the mirror opposite of *refpoint*. Specify inset box attributes via diff --git a/pygmt/src/text.py b/pygmt/src/text.py index d9ce2357a5b..984f4f395c0 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -89,7 +89,8 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 * *y*: Y coordinate or latitude * *angle*: Angle in degrees counter-clockwise from horizontal * *font*: Text size, font, and color - * *justify*: Two-character justification code + * *justify*: + :doc:`2-character justification code ` * *text*: The text string to typeset The *angle*, *font*, and *justify* columns are optional and can be set From 38d8c857f8e292a4dbe7443a8ff1f70e9a7bba07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 25 Aug 2025 21:28:27 +0200 Subject: [PATCH 34/48] Fix indent --- pygmt/src/colorbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index 1b0be7c631f..6e85db5ec76 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -69,7 +69,7 @@ def colorbar( Define the reference point on the map for the color scale using one of four coordinate systems: (1) Use **g** for map (user) coordinates, (2) use **j** or **J** for setting *refpoint* via a - :doc:`2-character justification code ` + :doc:`2-character justification code ` that refers to the (invisible) map domain rectangle, (3) use **n** for normalized (0-1) coordinates, or (4) use **x** for plot coordinates (inches, cm, etc.). All but **x** requires both From e8b8fd752932d5e3ef5398d5a1ed104eac52d331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 25 Aug 2025 21:43:33 +0200 Subject: [PATCH 35/48] Mention techref in gallery examples and tutorials --- examples/gallery/embellishments/colorbar.py | 5 ++--- examples/gallery/embellishments/scalebar.py | 14 ++++++-------- examples/tutorials/basics/text.py | 14 +++----------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/examples/gallery/embellishments/colorbar.py b/examples/gallery/embellishments/colorbar.py index 84010591e4a..c97f8b42838 100644 --- a/examples/gallery/embellishments/colorbar.py +++ b/examples/gallery/embellishments/colorbar.py @@ -11,9 +11,8 @@ followed by the desired interval. The placement of the colorbar is set via the ``position`` parameter. There are the following options: -- **j/J**: placed inside/outside the plot bounding box using any 2-character - combination of vertical (**T**\ op, **M**\ iddle, **B**\ ottom) and - horizontal (**L**\ eft, **C**\ enter, **R**\ ight) alignment codes, e.g. +- **j/J**: placed inside/outside the plot bounding box using a + :doc:`2-character justification code `, e.g., ``position="jTR"`` for Top Right. - **g**: using map coordinates, e.g. ``position="g170/-45"`` for longitude 170° East, latitude 45° South. diff --git a/examples/gallery/embellishments/scalebar.py b/examples/gallery/embellishments/scalebar.py index 88794cb5c95..1980307b602 100644 --- a/examples/gallery/embellishments/scalebar.py +++ b/examples/gallery/embellishments/scalebar.py @@ -10,11 +10,10 @@ of the reference point. Choose from - **g**: Give map coordinates as *longitude*\/\ *latitude*. - - **j**\|\ **J**: Specify a two-character (order independent) code. - Choose from vertical **T**\(op), **M**\(iddle), or **B**\(ottom) and - horizontal **L**\(eft), **C**\(entre), or **R**\(ight). Lower / - uppercase **j** / **J** mean inside / outside of the map bounding - box. + - **j**\|\ **J**: Specify a + :doc:`2-character justification code `. + Lower / uppercase **j** / **J** mean inside / outside of the map + bounding box. - **n**: Give normalized bounding box coordinates as *nx*\/\ *ny*. - **x**: Give plot coordinates as *x*\/\ *y*. @@ -26,9 +25,8 @@ **+c** is appended the middle of the map is used. Note that *slon* is only optional for projections with constant scale along parallels, e.g., Mercator projection. - - justify: **+j**. Set the anchor point. Specify a two-character (order - independent) code. Choose from vertical **T**\(op), **M**\(iddle), or - **B**\(ottom) and horizontal **L**\(eft), **C**\(entre), or **R**\(ight). + - justify: **+j**. Set the anchor point. Specify a + :doc:`2-character justification code `. - offset: **+o**\ *offset* or **+o**\ *xoffset*/\ *yoffset*. Give either a common shift or individual shifts in x- (longitude) and y- (latitude) directions. diff --git a/examples/tutorials/basics/text.py b/examples/tutorials/basics/text.py index 6ac39ebc174..fb12cfa65b9 100644 --- a/examples/tutorials/basics/text.py +++ b/examples/tutorials/basics/text.py @@ -37,11 +37,7 @@ # * ``angle``: Specifies the rotation of the text. It is measured counter-clockwise # from the horizontal in degrees. # * ``justify``: Defines the anchor point of the bounding box for the text. It is -# specified by a two-letter (order independent) code, chosen from: -# -# * Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) -# * Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) -# +# specified by a :doc:`2-character justification code `. # * ``offset``: Shifts the text relatively to the reference point. fig = pygmt.Figure() @@ -191,12 +187,8 @@ # # Instead of using the ``x`` and ``y`` parameters, the ``position`` parameter can be # specified to set the reference point for the text on the plot. As for the ``justify`` -# parameter, the ``position`` parameter is specified by a two-letter (order independent) -# code, chosen from: -# -# * Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) -# * Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) -# +# parameter, the ``position`` parameter is specified by a +# :doc:`2-character justification code `. # This can be helpful to add a tag to a subplot or text labels out of the plot or map # frame, e.g., for depth slices. From 02435292025daa13c1326ad0307b3d19e6297b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 25 Aug 2025 22:08:05 +0200 Subject: [PATCH 36/48] Remove blank line --- doc/techref/justification_codes.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 785362ca8ab..63768657ddf 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -10,7 +10,6 @@ somewhere on the figure (reference point) and a point on the feature (anchor point). For both, users can use a two-character (order-independent) code, a combination of a vertical code and a horizontal code: - - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) From 3dbcacc6e8e5444f4c6eee61d3540d6c1b8afa17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Mon, 25 Aug 2025 22:16:45 +0200 Subject: [PATCH 37/48] Mention techref in docs --- pygmt/src/text.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pygmt/src/text.py b/pygmt/src/text.py index 984f4f395c0..7995a22de4a 100644 --- a/pygmt/src/text.py +++ b/pygmt/src/text.py @@ -104,12 +104,8 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 position Set reference point on the map for the text by using x, y coordinates extracted from ``region`` instead of providing them - through ``x``/``y``. Specify with a two-letter (order independent) - code, chosen from: - - * Vertical: **T**\ (op), **M**\ (iddle), **B**\ (ottom) - * Horizontal: **L**\ (eft), **C**\ (entre), **R**\ (ight) - + through ``x``/``y``. Specify with a + :doc:`2-character justification code `. For example, ``position="TL"`` plots the text at the Top Left corner of the map. text @@ -129,10 +125,9 @@ def text_( # noqa: PLR0912, PLR0913, PLR0915 columns. justify Set the alignment which refers to the part of the text string that - will be mapped onto the (x, y) point. Choose a two-letter - combination of **L**, **C**, **R** (for left, center, or right) and - **T**, **M**, **B** (for top, middle, or bottom). E.g., **BL** for - bottom left. If no justification is explicitly given + will be mapped onto the (x, y) point. Choose a + :doc:`2-character justification code `, + e.g., **BL** for Bottom Left. If no justification is explicitly given (i.e. ``justify=True``), then the input to ``textfiles`` must have this as a column. {projection} From 6fbefa343d99aa2ded13f1e44e5444a47a52c7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 2 Sep 2025 14:46:30 +0200 Subject: [PATCH 38/48] Improve formulation --- doc/techref/justification_codes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 63768657ddf..2713177ec82 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -7,8 +7,8 @@ file_format: mystnb To place plot embellishments, such as scalebars, directional roses, colorbars, legends, text, and images on a figure two points have to be specified: a point somewhere on the figure (reference point) and a point on the feature (anchor -point). For both, users can use a two-character (order-independent) code, a -combination of a vertical code and a horizontal code: +point). For both, users can use a two-character code, a combination of a vertical +code and a horizontal code (order-independent): - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) From 6e79fcb7e890ca8620461791db9927ec698833f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:10:37 +0200 Subject: [PATCH 39/48] Add justification code example Co-authored-by: Dongdong Tian --- doc/techref/justification_codes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 2713177ec82..761bee0d0d1 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -12,7 +12,7 @@ code and a horizontal code (order-independent): - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) - Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) - +For example, `"TL"` means **T**op **L**eft. The possible nine justification codes are visualized in the sketch below: ```{code-cell} From 0f1120eba07da2c05ba49436449b5d0ce92839dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:11:02 +0200 Subject: [PATCH 40/48] Highlight points in bold Co-authored-by: Dongdong Tian --- doc/techref/justification_codes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 761bee0d0d1..1202915f066 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -6,8 +6,8 @@ file_format: mystnb To place plot embellishments, such as scalebars, directional roses, colorbars, legends, text, and images on a figure two points have to be specified: a point -somewhere on the figure (reference point) and a point on the feature (anchor -point). For both, users can use a two-character code, a combination of a vertical +somewhere on the figure (**reference point**) and a point on the feature (**anchor +point**). For both, users can use a two-character code, a combination of a vertical code and a horizontal code (order-independent): - Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) From d37f3dc6ead331df259a1e90b8c0c0addac03e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:23:28 +0200 Subject: [PATCH 41/48] Improve formulation Co-authored-by: Dongdong Tian --- doc/techref/justification_codes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 1202915f066..40a39f3a9e1 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -5,7 +5,7 @@ file_format: mystnb # Justification codes To place plot embellishments, such as scalebars, directional roses, colorbars, -legends, text, and images on a figure two points have to be specified: a point +legends, text, or images on a figure, two points have to be specified: a point somewhere on the figure (**reference point**) and a point on the feature (**anchor point**). For both, users can use a two-character code, a combination of a vertical code and a horizontal code (order-independent): From 10d94ea9d781ad66920fab3fda84f083b8faa361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 2 Sep 2025 15:34:14 +0200 Subject: [PATCH 42/48] No need to escape Co-authored-by: Dongdong Tian --- doc/techref/justification_codes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 40a39f3a9e1..ffafe9dcf6a 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -10,8 +10,8 @@ somewhere on the figure (**reference point**) and a point on the feature (**anch point**). For both, users can use a two-character code, a combination of a vertical code and a horizontal code (order-independent): -- Vertical: **T**\(op), **M**\(iddle), **B**\(ottom) -- Horizontal: **L**\(eft), **C**\(entre), **R**\(ight) +- Vertical: **T**(op), **M**(iddle), **B**(ottom) +- Horizontal: **L**(eft), **C**(entre), **R**(ight) For example, `"TL"` means **T**op **L**eft. The possible nine justification codes are visualized in the sketch below: From a06ad419ec96095170fa4759cad41085e930a19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 2 Sep 2025 15:35:44 +0200 Subject: [PATCH 43/48] Add blank line --- doc/techref/justification_codes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index ffafe9dcf6a..9711320f15e 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -12,6 +12,7 @@ code and a horizontal code (order-independent): - Vertical: **T**(op), **M**(iddle), **B**(ottom) - Horizontal: **L**(eft), **C**(entre), **R**(ight) + For example, `"TL"` means **T**op **L**eft. The possible nine justification codes are visualized in the sketch below: From b6cab8cd284ae8843697f7cffecdd54b0201010d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 2 Sep 2025 23:12:53 +0200 Subject: [PATCH 44/48] Add blank line --- doc/techref/justification_codes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 9711320f15e..b073f61d8dd 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -14,6 +14,7 @@ code and a horizontal code (order-independent): - Horizontal: **L**(eft), **C**(entre), **R**(ight) For example, `"TL"` means **T**op **L**eft. + The possible nine justification codes are visualized in the sketch below: ```{code-cell} From e8d060284cb8feb077ae1a612464d6d062b007db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 2 Sep 2025 23:14:12 +0200 Subject: [PATCH 45/48] Use line length --- doc/techref/justification_codes.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index b073f61d8dd..165e7b52ec9 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -4,11 +4,11 @@ file_format: mystnb # Justification codes -To place plot embellishments, such as scalebars, directional roses, colorbars, -legends, text, or images on a figure, two points have to be specified: a point -somewhere on the figure (**reference point**) and a point on the feature (**anchor -point**). For both, users can use a two-character code, a combination of a vertical -code and a horizontal code (order-independent): +To place plot embellishments, such as scalebars, directional roses, colorbars, legends, +text, or images on a figure, two points have to be specified: a point somewhere on the +figure (**reference point**) and a point on the feature (**anchor point**). For both, +users can use a two-character code, a combination of a vertical code and a horizontal +code (order-independent): - Vertical: **T**(op), **M**(iddle), **B**(ottom) - Horizontal: **L**(eft), **C**(entre), **R**(ight) From dd648cff0d0e8aa61778f046df8738a51fb3ca33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:19:36 +0200 Subject: [PATCH 46/48] Add blank line Co-authored-by: Dongdong Tian --- doc/techref/justification_codes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index 165e7b52ec9..fe392176048 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -15,6 +15,7 @@ code (order-independent): For example, `"TL"` means **T**op **L**eft. + The possible nine justification codes are visualized in the sketch below: ```{code-cell} From a93097030c4ec064251e8b9d584ad32b3194ee96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:20:02 +0200 Subject: [PATCH 47/48] Add more information Co-authored-by: Dongdong Tian --- doc/techref/justification_codes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index fe392176048..a261b797c37 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -66,8 +66,8 @@ fig.text( fig.show(width=600) ``` -For a non-rectangular geographic basemap, the justification codes refer to the map -bounding box: +For a non-rectangular geographic basemap, the justification codes refer to the invisible, +rectangular map bounding box: ```{code-cell} --- From 10cd6f38c50ee6506abfb8d0db298b9d74415563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Tue, 2 Sep 2025 23:22:15 +0200 Subject: [PATCH 48/48] Remove one blank line --- doc/techref/justification_codes.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/techref/justification_codes.md b/doc/techref/justification_codes.md index a261b797c37..671d63f30e9 100644 --- a/doc/techref/justification_codes.md +++ b/doc/techref/justification_codes.md @@ -15,7 +15,6 @@ code (order-independent): For example, `"TL"` means **T**op **L**eft. - The possible nine justification codes are visualized in the sketch below: ```{code-cell}