From c2145cbf2d5472b2b22243de620e7afeaea643dc Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Mon, 28 Feb 2022 17:49:41 -0500 Subject: [PATCH 01/10] Draft a tutorial demonstrating grdhisteq --- .../tutorials/advanced/grid_equalization.py | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 examples/tutorials/advanced/grid_equalization.py diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py new file mode 100644 index 00000000000..1feb2841301 --- /dev/null +++ b/examples/tutorials/advanced/grid_equalization.py @@ -0,0 +1,221 @@ +""" +Performing grid histogram equalization +-------------------------------------- +The :meth:`pygmt.grdhisteq.equalize_grid` function creates a grid with +statistics based on a cumulative distribution function. +""" +# sphinx_gallery_thumbnail_number = 3 + +import pygmt + +############################################################################### +# Load sample data +# ---------------- +# Load the sample Earth relief data for a region around Yosemite valley +# and use :meth:`pygmt.grd2xyz` to create a numpy.ndarray with the z values. +region = [-119.825, -119.4, 37.6, 37.825] + +grid = pygmt.datasets.load_earth_relief(resolution="03s", region=region) +grid_dist = pygmt.grd2xyz(grid=grid, outcols=2, output_type="numpy")[:, 0] + +############################################################################### +# Plot the original digital elevation model and data distribution +# --------------------------------------------------------------- +# For comparison, we will create a map of the original digital elevation +# model and a histogram showing the distribution of data values. + +# Create an instance of the Figure class +fig = pygmt.Figure() +# Define figure configuration +pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain") +# Define the colormap for the figure +pygmt.makecpt(series=[500, 3540], cmap="turku") +# Define the position of the colormap +cmap_position = "JMR+o1c/0c+w3c/0.3c" +# Setup subplots with two panels +with fig.subplot( + nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Digital Elevation Model" +): + # Plot the original digital elevation model in the first panel + with fig.set_panel(panel=0): + fig.grdimage(grid=grid, projection="M?", frame="WSne", cmap=True) + # Plot a histogram showing the z-value distribution in the original digital + # elevation model + with fig.set_panel(panel=1): + fig.histogram( + data=grid_dist, + projection="X?", + region=[500, 3540, 0, 20], + series=[500, 3540, 100], + frame="wnSE", + cmap=True, + histtype=1, + pen="1p,black", + ) + fig.colorbar(position=cmap_position, frame=True) +fig.show() + +############################################################################### +# Equalize grid based on a linear distribution +# -------------------------------------------- +# The :meth:`pygmt.grdhisteq.equalize_grid` method creates a new grid with the +# z-values representing the position of the original z-values in a given +# cumulative distribution. By default, it computes the position in a linear +# distribution. Here, we equalize the grid into nine divisions based on a +# linear distribution and produce a numpy.ndarray with the z-values for the new +# grid. + +divisions = 9 +linear = pygmt.grdhisteq.equalize_grid(grid=grid, divisions=divisions) +linear_dist = pygmt.grd2xyz(grid=linear, outcols=2, output_type="numpy")[:, 0] + +############################################################################### +# Calculate the bins used for data transformation +# ----------------------------------------------- +# The :meth:`pygmt.grdhisteq.compute_bins` method reports statistics about the +# grid equalization. Here, we report the bins that would linearly divide the +# original data into 9 divisions with equal area. In our new grid produce by +# :meth:`pygmt.grdhisteq.equalize_grid`, all the grid cells with values between +# ``start`` and ``stop`` of ``bin_id=0`` are assigned the value 0, all grid +# cells with values between ``start`` and ``stop`` of ``bin_id=1`` are assigned +# the value 1, and so on. + +pygmt.grdhisteq.compute_bins(grid=grid, divisions=divisions) + +############################################################################### +# Plot the equally distributed data +# --------------------------------------------------------------- +# Here we create a map showing the grid that has been transformed to +# have a linear distribution with nine divisions and a histogram of the data +# values. + +# Create an instance of the Figure class +fig = pygmt.Figure() +# Define figure configuration +pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain") +# Define the colormap for the figure +pygmt.makecpt(series=[0, divisions, 1], cmap="lajolla") +# Setup subplots with two panels +with fig.subplot( + nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Linear distribution" +): + # Plot the grid with a linear distribution in the first panel + with fig.set_panel(panel=0): + fig.grdimage(grid=linear, projection="M?", frame="WSne", cmap=True) + # Plot a histogram showing the linear z-value distribution + with fig.set_panel(panel=1): + fig.histogram( + data=linear_dist, + projection="X?", + region=[0, divisions, 0, 40], + series=[0, divisions, 1], + frame="wnSE", + cmap=True, + histtype=1, + pen="1p,black", + ) + fig.colorbar(position=cmap_position, frame=True) +fig.show() + +############################################################################### +# Transform grid based on a normal distribution +# --------------------------------------------- +# The ``gaussian`` parameter of :meth:`pygmt.grdhisteq.equalize_grid` can be +# used to transform the z-values relative to their position in a normal +# distribution rather than a linear distribution. In this case, the output +# data are continuous rather than discrete. + +normal = pygmt.grdhisteq.equalize_grid(grid=grid, gaussian=True) +normal_dist = pygmt.grd2xyz(grid=normal, outcols=2, output_type="numpy")[:, 0] + +############################################################################### +# Plot the normally distributed data +# ---------------------------------- +# Here we create a map showing the grid that has been transformed to have +# a normal distribution and a histogram of the data values. + +# Create an instance of the Figure class +fig = pygmt.Figure() +# Define figure configuration +pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain") +# Define the colormap for the figure +pygmt.makecpt(series=[-4.5, 4.5], cmap="vik") +# Setup subplots with two panels +with fig.subplot( + nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Normal distribution" +): + # Plot the grid with a normal distribution in the first panel + with fig.set_panel(panel=0): + fig.grdimage(grid=normal, projection="M?", frame="WSne", cmap=True) + # Plot a histogram showing the normal z-value distribution + with fig.set_panel(panel=1): + fig.histogram( + data=normal_dist, + projection="X?", + region=[-4.5, 4.5, 0, 20], + series=[-4.5, 4.5, 0.2], + frame="wnSE", + cmap=True, + histtype=1, + pen="1p,black", + ) + fig.colorbar(position=cmap_position, frame=True) +fig.show() + +############################################################################### +# Equalize grid based on a quadratic distribution +# ----------------------------------------------- +# The ``quadratic`` parameter of :meth:`pygmt.grdhisteq.equalize_grid` can be +# used to transform the z-values relative to their position in a quadratic +# distribution rather than a linear distribution. Here, we equalize the grid +# into nine divisions based on a quadratic distribution and produce a +# numpy.ndarray with the z-values for the new grid. + +quadratic = pygmt.grdhisteq.equalize_grid( + grid=grid, quadratic=True, divisions=divisions +) +quadratic_dist = pygmt.grd2xyz(grid=quadratic, outcols=2, output_type="numpy")[:, 0] + +############################################################################### +# Calculate the bins used for data transformation +# ----------------------------------------------- +# We can also use the ``quadratic`` parameter of +# :meth:`pygmt.grdhisteq.compute_bins` to report the bins used for dividing +# the grid into 9 divisions based on their position in a quadratic +# distribution. + +pygmt.grdhisteq.compute_bins(grid=grid, divisions=divisions, quadratic=True) + +############################################################################### +# Plot the quadratic distribution of data +# --------------------------------------- +# Here we create a map showing the grid that has been transformed to have +# a quadratic distribution and a histogram of the data values. + +# Create an instance of the Figure class +fig = pygmt.Figure() +# Define figure configuration +pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain") +# Define the colormap for the figure +pygmt.makecpt(series=[0, divisions, 1], cmap="lajolla") +# Setup subplots with two panels +with fig.subplot( + nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Quadratic distribution" +): + # Plot the grid with a quadratic distribution in the first panel + with fig.set_panel(panel=0): + fig.grdimage(grid=quadratic, projection="M?", frame="WSne", cmap=True) + # Plot a histogram showing the quadratic z-value distribution + with fig.set_panel(panel=1): + fig.histogram( + data=quadratic_dist, + projection="X?", + region=[0, divisions, 0, 40], + series=[0, divisions, 1], + frame="wnSE", + cmap=True, + histtype=1, + pen="1p,black", + ) + fig.colorbar(position=cmap_position, frame=True) +fig.show() From df83c0f8615bee1af648877f6d352aea0d9c553b Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Tue, 15 Mar 2022 17:56:27 -0400 Subject: [PATCH 02/10] Update bins --- examples/tutorials/advanced/grid_equalization.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index 1feb2841301..035805a9ca3 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -12,7 +12,8 @@ # Load sample data # ---------------- # Load the sample Earth relief data for a region around Yosemite valley -# and use :meth:`pygmt.grd2xyz` to create a numpy.ndarray with the z values. +# and use :meth:`pygmt.grd2xyz` to create a :class:`numpy.ndarray` with the z +# values. region = [-119.825, -119.4, 37.6, 37.825] grid = pygmt.datasets.load_earth_relief(resolution="03s", region=region) @@ -45,8 +46,8 @@ fig.histogram( data=grid_dist, projection="X?", - region=[500, 3540, 0, 20], - series=[500, 3540, 100], + region=[500, 3600, 0, 20], + series=[500, 3600, 100], frame="wnSE", cmap=True, histtype=1, From e8cf6139af47d437ba8fed951104e85d2ce4f8af Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Tue, 5 Apr 2022 18:39:49 -0400 Subject: [PATCH 03/10] Apply suggestion from code review Co-authored-by: Dongdong Tian --- examples/tutorials/advanced/grid_equalization.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index 035805a9ca3..23035e6345b 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -17,7 +17,7 @@ region = [-119.825, -119.4, 37.6, 37.825] grid = pygmt.datasets.load_earth_relief(resolution="03s", region=region) -grid_dist = pygmt.grd2xyz(grid=grid, outcols=2, output_type="numpy")[:, 0] +grid_dist = pygmt.grd2xyz(grid=grid, output_type="pandas")["elevation"] ############################################################################### # Plot the original digital elevation model and data distribution @@ -68,7 +68,7 @@ divisions = 9 linear = pygmt.grdhisteq.equalize_grid(grid=grid, divisions=divisions) -linear_dist = pygmt.grd2xyz(grid=linear, outcols=2, output_type="numpy")[:, 0] +linear_dist = pygmt.grd2xyz(grid=linear, output_type="pandas")["z"] ############################################################################### # Calculate the bins used for data transformation @@ -127,7 +127,7 @@ # data are continuous rather than discrete. normal = pygmt.grdhisteq.equalize_grid(grid=grid, gaussian=True) -normal_dist = pygmt.grd2xyz(grid=normal, outcols=2, output_type="numpy")[:, 0] +normal_dist = pygmt.grd2xyz(grid=normal, output_type="pandas")["z"] ############################################################################### # Plot the normally distributed data @@ -175,7 +175,7 @@ quadratic = pygmt.grdhisteq.equalize_grid( grid=grid, quadratic=True, divisions=divisions ) -quadratic_dist = pygmt.grd2xyz(grid=quadratic, outcols=2, output_type="numpy")[:, 0] +quadratic_dist = pygmt.grd2xyz(grid=quadratic, output_type="pandas")["z"] ############################################################################### # Calculate the bins used for data transformation From a174dec083856f123b148142103973e6b8304832 Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Wed, 6 Apr 2022 10:59:14 -0400 Subject: [PATCH 04/10] Apply suggestions from code review Co-authored-by: Dongdong Tian --- examples/tutorials/advanced/grid_equalization.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index 23035e6345b..50f9998eea4 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -12,11 +12,10 @@ # Load sample data # ---------------- # Load the sample Earth relief data for a region around Yosemite valley -# and use :meth:`pygmt.grd2xyz` to create a :class:`numpy.ndarray` with the z -# values. -region = [-119.825, -119.4, 37.6, 37.825] +# and use :meth:`pygmt.grd2xyz` to create a :class:`pandas.Series` with the +# z values. -grid = pygmt.datasets.load_earth_relief(resolution="03s", region=region) +grid = pygmt.datasets.load_earth_relief(resolution="03s", region=[-119.825, -119.4, 37.6, 37.825]) grid_dist = pygmt.grd2xyz(grid=grid, output_type="pandas")["elevation"] ############################################################################### @@ -63,8 +62,8 @@ # z-values representing the position of the original z-values in a given # cumulative distribution. By default, it computes the position in a linear # distribution. Here, we equalize the grid into nine divisions based on a -# linear distribution and produce a numpy.ndarray with the z-values for the new -# grid. +# linear distribution and produce a pandas.Series with the z-values for the +# new grid. divisions = 9 linear = pygmt.grdhisteq.equalize_grid(grid=grid, divisions=divisions) @@ -170,7 +169,7 @@ # used to transform the z-values relative to their position in a quadratic # distribution rather than a linear distribution. Here, we equalize the grid # into nine divisions based on a quadratic distribution and produce a -# numpy.ndarray with the z-values for the new grid. +# pandas.Series with the z-values for the new grid. quadratic = pygmt.grdhisteq.equalize_grid( grid=grid, quadratic=True, divisions=divisions From e87b1ea4cbd4c3fb54c53af1cb84d67dd84db17f Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Wed, 6 Apr 2022 11:01:50 -0400 Subject: [PATCH 05/10] Format --- examples/tutorials/advanced/grid_equalization.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index 50f9998eea4..a72c3a7cb91 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -15,7 +15,9 @@ # and use :meth:`pygmt.grd2xyz` to create a :class:`pandas.Series` with the # z values. -grid = pygmt.datasets.load_earth_relief(resolution="03s", region=[-119.825, -119.4, 37.6, 37.825]) +grid = pygmt.datasets.load_earth_relief( + resolution="03s", region=[-119.825, -119.4, 37.6, 37.825] +) grid_dist = pygmt.grd2xyz(grid=grid, output_type="pandas")["elevation"] ############################################################################### From a5aaea47dad2d7b7f5081bbd4e81ec16330f8b56 Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Thu, 7 Apr 2022 12:41:21 -0400 Subject: [PATCH 06/10] Apply suggestions from code review Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Dongdong Tian --- examples/tutorials/advanced/grid_equalization.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index a72c3a7cb91..897dad8466c 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -24,7 +24,7 @@ # Plot the original digital elevation model and data distribution # --------------------------------------------------------------- # For comparison, we will create a map of the original digital elevation -# model and a histogram showing the distribution of data values. +# model and a histogram showing the distribution of elevation data values. # Create an instance of the Figure class fig = pygmt.Figure() @@ -49,7 +49,7 @@ projection="X?", region=[500, 3600, 0, 20], series=[500, 3600, 100], - frame="wnSE", + frame=["wnSE", "xaf+lElevation (m)", "yaf+lCounts"], cmap=True, histtype=1, pen="1p,black", @@ -64,8 +64,8 @@ # z-values representing the position of the original z-values in a given # cumulative distribution. By default, it computes the position in a linear # distribution. Here, we equalize the grid into nine divisions based on a -# linear distribution and produce a pandas.Series with the z-values for the -# new grid. +# linear distribution and produce a :class:`pandas.Series` with the z-values +# for the new grid. divisions = 9 linear = pygmt.grdhisteq.equalize_grid(grid=grid, divisions=divisions) @@ -76,7 +76,7 @@ # ----------------------------------------------- # The :meth:`pygmt.grdhisteq.compute_bins` method reports statistics about the # grid equalization. Here, we report the bins that would linearly divide the -# original data into 9 divisions with equal area. In our new grid produce by +# original data into 9 divisions with equal area. In our new grid produced by # :meth:`pygmt.grdhisteq.equalize_grid`, all the grid cells with values between # ``start`` and ``stop`` of ``bin_id=0`` are assigned the value 0, all grid # cells with values between ``start`` and ``stop`` of ``bin_id=1`` are assigned From adb1cfcf361cb52b663e7e17761d8a7c6ca93648 Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Thu, 7 Apr 2022 12:43:44 -0400 Subject: [PATCH 07/10] Do not use variable for colorbar position --- examples/tutorials/advanced/grid_equalization.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index 897dad8466c..fe2b9e46f4a 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -32,8 +32,6 @@ pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain") # Define the colormap for the figure pygmt.makecpt(series=[500, 3540], cmap="turku") -# Define the position of the colormap -cmap_position = "JMR+o1c/0c+w3c/0.3c" # Setup subplots with two panels with fig.subplot( nrows=1, ncols=2, figsize=("13.5c", "4c"), title="Digital Elevation Model" @@ -54,7 +52,7 @@ histtype=1, pen="1p,black", ) - fig.colorbar(position=cmap_position, frame=True) + fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) fig.show() ############################################################################### @@ -116,7 +114,7 @@ histtype=1, pen="1p,black", ) - fig.colorbar(position=cmap_position, frame=True) + fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) fig.show() ############################################################################### @@ -161,7 +159,7 @@ histtype=1, pen="1p,black", ) - fig.colorbar(position=cmap_position, frame=True) + fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) fig.show() ############################################################################### @@ -219,5 +217,5 @@ histtype=1, pen="1p,black", ) - fig.colorbar(position=cmap_position, frame=True) + fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) fig.show() From a188b3784d26cfa91e6c21ef16f16d4c93ca42c2 Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Fri, 8 Apr 2022 09:36:06 -0400 Subject: [PATCH 08/10] Update examples/tutorials/advanced/grid_equalization.py Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- examples/tutorials/advanced/grid_equalization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index fe2b9e46f4a..4a1337631bc 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -1,7 +1,7 @@ """ Performing grid histogram equalization -------------------------------------- -The :meth:`pygmt.grdhisteq.equalize_grid` function creates a grid with +The :meth:`pygmt.grdhisteq.equalize_grid` function creates a grid using statistics based on a cumulative distribution function. """ # sphinx_gallery_thumbnail_number = 3 From 5bc3b4b1bd097aa62d5f412b87e54128bcdc8e53 Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Fri, 8 Apr 2022 11:18:23 -0400 Subject: [PATCH 09/10] Add labels and improve cbar position for histograms Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> --- examples/tutorials/advanced/grid_equalization.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index 4a1337631bc..b0e5a9c5ec7 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -52,7 +52,7 @@ histtype=1, pen="1p,black", ) - fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) + fig.colorbar(position="JMR+o1.5c/0c+w3c/0.3c", frame=True) fig.show() ############################################################################### @@ -109,12 +109,12 @@ projection="X?", region=[0, divisions, 0, 40], series=[0, divisions, 1], - frame="wnSE", + frame=["wnSE", "xaf+lElevation (m)", "yaf+lCounts"], cmap=True, histtype=1, pen="1p,black", ) - fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) + fig.colorbar(position="JMR+o1.5c/0c+w3c/0.3c", frame=True) fig.show() ############################################################################### @@ -154,12 +154,12 @@ projection="X?", region=[-4.5, 4.5, 0, 20], series=[-4.5, 4.5, 0.2], - frame="wnSE", + frame=["wnSE", "xaf+lElevation (m)", "yaf+lCounts"], cmap=True, histtype=1, pen="1p,black", ) - fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) + fig.colorbar(position="JMR+o1.5c/0c+w3c/0.3c", frame=True) fig.show() ############################################################################### @@ -212,10 +212,10 @@ projection="X?", region=[0, divisions, 0, 40], series=[0, divisions, 1], - frame="wnSE", + frame=["wnSE", "xaf+lElevation (m)", "yaf+lCounts"], cmap=True, histtype=1, pen="1p,black", ) - fig.colorbar(position="JMR+o1c/0c+w3c/0.3c", frame=True) + fig.colorbar(position="JMR+o1.5c/0c+w3c/0.3c", frame=True) fig.show() From a13e9f925ad4fa5f7cfa52e5088a8b0f2ee9a3c7 Mon Sep 17 00:00:00 2001 From: Meghan Jones Date: Fri, 8 Apr 2022 11:22:50 -0400 Subject: [PATCH 10/10] Update examples/tutorials/advanced/grid_equalization.py Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> --- examples/tutorials/advanced/grid_equalization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorials/advanced/grid_equalization.py b/examples/tutorials/advanced/grid_equalization.py index b0e5a9c5ec7..d640198f1ba 100644 --- a/examples/tutorials/advanced/grid_equalization.py +++ b/examples/tutorials/advanced/grid_equalization.py @@ -169,7 +169,7 @@ # used to transform the z-values relative to their position in a quadratic # distribution rather than a linear distribution. Here, we equalize the grid # into nine divisions based on a quadratic distribution and produce a -# pandas.Series with the z-values for the new grid. +# :class:`pandas.Series` with the z-values for the new grid. quadratic = pygmt.grdhisteq.equalize_grid( grid=grid, quadratic=True, divisions=divisions