From 533d4a252a9916aaeedda8d3350d9d565bf2b5b3 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 12 Aug 2022 09:09:21 +0200 Subject: [PATCH 1/3] Use GMT terminology 'annotations' (for labels) --- examples/gallery/symbols/points_categorical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/symbols/points_categorical.py b/examples/gallery/symbols/points_categorical.py index 43331ef3f28..2629a147cac 100644 --- a/examples/gallery/symbols/points_categorical.py +++ b/examples/gallery/symbols/points_categorical.py @@ -26,7 +26,7 @@ # Make a list of the individual categories of the 'species' column # ['Adelie', 'Chinstrap', 'Gentoo'] # They are (corresponding to the categorical number code) by default in -# alphabetical order and later used for the colorbar labels +# alphabetical order and later used for the colorbar annotations labels = list(df.species.cat.categories) # Use pygmt.info to get region bounds (xmin, xmax, ymin, ymax) From 462ef3143c816e1662cfc7119c4e2b2506dc3f3a Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 12 Aug 2022 09:27:32 +0200 Subject: [PATCH 2/3] Adjust variable name regarding GMT terminology --- examples/gallery/symbols/points_categorical.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gallery/symbols/points_categorical.py b/examples/gallery/symbols/points_categorical.py index 2629a147cac..81b6eb6e30d 100644 --- a/examples/gallery/symbols/points_categorical.py +++ b/examples/gallery/symbols/points_categorical.py @@ -27,7 +27,7 @@ # ['Adelie', 'Chinstrap', 'Gentoo'] # They are (corresponding to the categorical number code) by default in # alphabetical order and later used for the colorbar annotations -labels = list(df.species.cat.categories) +cb_annot = list(df.species.cat.categories) # Use pygmt.info to get region bounds (xmin, xmax, ymin, ymax) # The below example will return a numpy array like [30.0, 60.0, 12.0, 22.0] @@ -65,7 +65,7 @@ # to set the lowest_value and the highest_value of the CPT series=(df.species.cat.codes.min(), df.species.cat.codes.max(), 1), # convert ['Adelie', 'Chinstrap', 'Gentoo'] to 'Adelie,Chinstrap,Gentoo' - color_model="+c" + ",".join(labels), + color_model="+c" + ",".join(cb_annot), ) fig.plot( From 1ca86a1752bbafd20e92a32e06ed45bfc0d6517e Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 12 Aug 2022 11:28:58 +0200 Subject: [PATCH 3/3] Use plural in variable name --- examples/gallery/symbols/points_categorical.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gallery/symbols/points_categorical.py b/examples/gallery/symbols/points_categorical.py index 81b6eb6e30d..f291c4a4a31 100644 --- a/examples/gallery/symbols/points_categorical.py +++ b/examples/gallery/symbols/points_categorical.py @@ -27,7 +27,7 @@ # ['Adelie', 'Chinstrap', 'Gentoo'] # They are (corresponding to the categorical number code) by default in # alphabetical order and later used for the colorbar annotations -cb_annot = list(df.species.cat.categories) +cb_annots = list(df.species.cat.categories) # Use pygmt.info to get region bounds (xmin, xmax, ymin, ymax) # The below example will return a numpy array like [30.0, 60.0, 12.0, 22.0] @@ -65,7 +65,7 @@ # to set the lowest_value and the highest_value of the CPT series=(df.species.cat.codes.min(), df.species.cat.codes.max(), 1), # convert ['Adelie', 'Chinstrap', 'Gentoo'] to 'Adelie,Chinstrap,Gentoo' - color_model="+c" + ",".join(cb_annot), + color_model="+c" + ",".join(cb_annots), ) fig.plot(