Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/gallery/symbols/points_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
# 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
labels = list(df.species.cat.categories)
# alphabetical order and later used for the colorbar annotations
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]
Expand Down Expand Up @@ -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_annots),
)

fig.plot(
Expand Down