Skip to content

Commit b9c0532

Browse files
committed
Make color map in plot_voronoi_cells adjustable
Closes #222
1 parent 1df9642 commit b9c0532

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pedpy/plotting/plotting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def plot_voronoi_cells( # pylint: disable=too-many-statements,too-many-branches
722722
line_width (optional): line width of the borders
723723
hole_color (optional): background color of holes
724724
hole_alpha (optional): alpha of background color for holes
725-
725+
cmap (optional): colormap used for
726726
Returns:
727727
matplotlib.axes.Axes instance where the Voronoi cells are plotted
728728
"""
@@ -737,6 +737,7 @@ def plot_voronoi_cells( # pylint: disable=too-many-statements,too-many-branches
737737
cb_location = kwargs.get("cb_location", "right")
738738
show_colorbar = kwargs.get("show_colorbar", True)
739739
color_by_column = kwargs.get("color_by_column", None)
740+
voronoi_colormap = plt.get_cmap(kwargs.get("cmap", "YlGn"))
740741

741742
if axes is None:
742743
axes = plt.gca()
@@ -763,7 +764,6 @@ def plot_voronoi_cells( # pylint: disable=too-many-statements,too-many-branches
763764
vmin = voronoi_data[color_by_column].min()
764765
if not vmax:
765766
vmax = voronoi_data[color_by_column].max()
766-
voronoi_colormap = plt.get_cmap("YlGn")
767767
norm = mpl.colors.Normalize(vmin, vmax)
768768
scalar_mappable = mpl.cm.ScalarMappable(
769769
norm=norm, cmap=voronoi_colormap

0 commit comments

Comments
 (0)