From 51bf8f3e779a14667d1090e09ce82cbabac0cada Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:29:00 +0100 Subject: [PATCH 1/8] Update docs to use consistently x direction and y direction Currently in the docs the versions - x direction - y direction - x-direction - y-direction are used. The first two are used most frequently. This PR makes the docs consistent. --- examples/tutorials/advanced/subplots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tutorials/advanced/subplots.py b/examples/tutorials/advanced/subplots.py index 1fb43fc02a4..4ed96202844 100644 --- a/examples/tutorials/advanced/subplots.py +++ b/examples/tutorials/advanced/subplots.py @@ -119,8 +119,8 @@ # # - ``autolabel=True``: Each subplot is automatically labelled 'abcd'. # - ``margins=["0.1c", "0.2c"]``: Adjusts the space between adjacent subplots. -# In this case, it is set as 0.1 cm in the x-direction and 0.2 cm in the -# y-direction. +# In this case, it is set as 0.1 cm in the x direction and 0.2 cm in the +# y direction. # - ``title="My Subplot Heading"``: Adds a title on top of the whole figure. # # Notice that each subplot was set to use a linear projection ``"X?"``. From b1f0825964a95971cdd52713e444c035cbbc24c4 Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:30:42 +0100 Subject: [PATCH 2/8] Update header.py --- pygmt/datatypes/header.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygmt/datatypes/header.py b/pygmt/datatypes/header.py index 197eaa26e45..69250909de6 100644 --- a/pygmt/datatypes/header.py +++ b/pygmt/datatypes/header.py @@ -92,9 +92,9 @@ class _GMT_GRID_HEADER(ctp.Structure): # noqa: N801 ("z_scale_factor", ctp.c_double), # After scaling, add this offset ("z_add_offset", ctp.c_double), - # Units in x-directions, in the form "long_name [units]" + # Units in x directions, in the form "long_name [units]" ("x_units", ctp.c_char * GMT_GRID_UNIT_LEN80), - # Units in y-direction, in the form "long_name [units]" + # Units in y direction, in the form "long_name [units]" ("y_units", ctp.c_char * GMT_GRID_UNIT_LEN80), # Grid value units, in the form "long_name [units]" ("z_units", ctp.c_char * GMT_GRID_UNIT_LEN80), @@ -122,9 +122,9 @@ class _GMT_GRID_HEADER(ctp.Structure): # noqa: N801 ("type", ctp.c_uint), # Number of bands [1]. Used with GMT_IMAGE containers ("n_bands", ctp.c_uint), - # Actual x-dimension in memory. mx = n_columns + pad[0] + pad[1] + # Actual x dimension in memory. mx = n_columns + pad[0] + pad[1] ("mx", ctp.c_uint), - # Actual y-dimension in memory. my = n_rows + pad[2] + pad[3] + # Actual y dimension in memory. my = n_rows + pad[2] + pad[3] ("my", ctp.c_uint), # Paddings on west, east, south, north sides [2,2,2,2] ("pad", ctp.c_uint * 4), From 2cdeb73a13fcc8003d3fa7b1651ceb887dd0947f Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:32:55 +0100 Subject: [PATCH 3/8] Update basemap.py --- pygmt/src/basemap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/basemap.py b/pygmt/src/basemap.py index 6355e2e02f7..b1864bd431f 100644 --- a/pygmt/src/basemap.py +++ b/pygmt/src/basemap.py @@ -60,7 +60,7 @@ def basemap(self, **kwargs): **+p**\ *pen*. Add **+g**\ *fill* to fill the scale panel [Default is no fill]. Append **+c**\ *clearance* where *clearance* is either gap, xgap/ygap, or lgap/rgap/bgap/tgap where these items are uniform, - separate in x- and y-direction, or individual side spacings between + separate in x and y direction, or individual side spacings between scale and border. Append **+i** to draw a secondary, inner border as well. We use a uniform gap between borders of 2p and the :gmt-term:`MAP_DEFAULTS_PEN` unless other values are specified. Append From a65cb2e035c487f87a9774d71e359f20b512bc31 Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:33:39 +0100 Subject: [PATCH 4/8] Update envelope.py --- examples/gallery/lines/envelope.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/lines/envelope.py b/examples/gallery/lines/envelope.py index c5d7e578f9c..49df129f6be 100644 --- a/examples/gallery/lines/envelope.py +++ b/examples/gallery/lines/envelope.py @@ -4,7 +4,7 @@ The ``close`` parameter of the :meth:`pygmt.Figure.plot` method can be used to build a symmetrical or an asymmetrical envelope. The user can give either the deviations or the -bounds in y-direction. For the first case append ``"+d"`` or ``"+D"`` and for the latter +bounds in y direction. For the first case append ``"+d"`` or ``"+D"`` and for the latter case ``"+b"``. """ From 466c18ffa350c78f889a075852ba7bf1d2188972 Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:34:48 +0100 Subject: [PATCH 5/8] Update colorbar.py --- pygmt/src/colorbar.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/src/colorbar.py b/pygmt/src/colorbar.py index c5e6f3fb5a9..2ecd8f80c92 100644 --- a/pygmt/src/colorbar.py +++ b/pygmt/src/colorbar.py @@ -78,8 +78,8 @@ def colorbar(self, **kwargs): Alternatively, specify a different pen with **+p**\ *pen*. Add **+g**\ *fill* to fill the scale panel [Default is no fill]. Append **+c**\ *clearance* where *clearance* is either gap, xgap/ygap, or - lgap/rgap/bgap/tgap where these items are uniform, separate in x- and - y-direction, or individual side spacings between scale and border. + lgap/rgap/bgap/tgap where these items are uniform, separate in x and + y direction, or individual side spacings between scale and border. Append **+i** to draw a secondary, inner border as well. We use a uniform gap between borders of 2p and the :gmt-term:`MAP_DEFAULTS_PEN` unless other values are specified. Append **+r** to draw rounded @@ -138,7 +138,7 @@ def colorbar(self, **kwargs): >>> fig.colorbar( ... # Set cmap to the "roma" CPT ... cmap="roma", - ... # Label the x-axis "Velocity" and the y-axis "m/s" + ... # Label the x axis "Velocity" and the y axis "m/s" ... frame=["x+lVelocity", "y+lm/s"], ... ) >>> # Show the plot From 74efafeaea3bd6c937d87d1dcb60b601d3a004cc Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:35:59 +0100 Subject: [PATCH 6/8] Update cartesian_histograms.py --- examples/tutorials/advanced/cartesian_histograms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tutorials/advanced/cartesian_histograms.py b/examples/tutorials/advanced/cartesian_histograms.py index 3a547fd92f5..4e3718d07c2 100644 --- a/examples/tutorials/advanced/cartesian_histograms.py +++ b/examples/tutorials/advanced/cartesian_histograms.py @@ -52,7 +52,7 @@ # Let ymin and ymax determined automatically by setting both to the same value region=[0, 200, 0, 0], projection="X10c", # Cartesian projection with a width of 10 centimeters - # Add frame, annotations ("a"), ticks ("f"), and y-axis label ("+l") "Counts"; the + # Add frame, annotations ("a"), ticks ("f"), and y axis label ("+l") "Counts"; the # numbers give the steps of annotations and ticks frame=["WStr", "xaf10", "ya1f1+lCounts"], data=data01, @@ -79,8 +79,8 @@ fill="red3", pen="1p,darkgray,solid", histtype=0, - # Use horizontal bars. Note that the x- and y-axis are flipped, with the x-axis - # plotted vertically and the y-axis plotted horizontally. + # Use horizontal bars. Note that the x and y axis are flipped, with the x axis + # plotted vertically and the y axis plotted horizontally. horizontal=True, ) @@ -212,7 +212,7 @@ histtype=0, # Show cumulative counts cumulative=True, - # Offset ("+o") the label by 10 points in negative y-direction + # Offset ("+o") the label by 10 points in negative y direction annotate="+o-10p", ) From 5e727f7c3cf9a1937a84055eaf496488886055d6 Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:36:47 +0100 Subject: [PATCH 7/8] Update inset.py --- pygmt/src/inset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/inset.py b/pygmt/src/inset.py index e05b038c5ac..74fa6f97d94 100644 --- a/pygmt/src/inset.py +++ b/pygmt/src/inset.py @@ -83,8 +83,8 @@ def inset(self, **kwargs): [Default is no fill]. Append **+c**\ *clearance* where *clearance* is either *gap*, *xgap*\ /\ *ygap*, or *lgap*\ /\ *rgap*\ /\ *bgap*\ /\ - *tgap* where these items are uniform, separate in x- and - y-directions, or individual side spacings between map embellishment + *tgap* where these items are uniform, separate in x and + y directions, or individual side spacings between map embellishment and border. Append **+i** to draw a secondary, inner border as well. We use a uniform *gap* between borders of 2p and the default pen unless other values are specified. Append **+r** to draw rounded From 20c38df2f9f8431a6b11e13ceafc90fe366d0af5 Mon Sep 17 00:00:00 2001 From: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:37:19 +0100 Subject: [PATCH 8/8] Update coast.py --- pygmt/src/coast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/coast.py b/pygmt/src/coast.py index 066c3b00de5..d67f7ea247e 100644 --- a/pygmt/src/coast.py +++ b/pygmt/src/coast.py @@ -119,7 +119,7 @@ def coast(self, **kwargs): **+p**\ *pen*. Add **+g**\ *fill* to fill the scale panel [Default is no fill]. Append **+c**\ *clearance* where *clearance* is either gap, xgap/ygap, or lgap/rgap/bgap/tgap where these items are uniform, - separate in x- and y-direction, or individual side spacings between + separate in x and y direction, or individual side spacings between scale and border. Append **+i** to draw a secondary, inner border as well. We use a uniform gap between borders of 2p and the :gmt-term:`MAP_DEFAULTS_PEN` unless other values are specified. Append