Skip to content

BUG: GH17525 Function _get_standard_colors resets random seed #17729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.21.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ Plotting
- Line plots no longer assume monotonic x data when calculating xlims, they show the entire lines now even for unsorted x data. (:issue:`11310`, :issue:`11471`)
- With matplotlib 2.0.0 and above, calculation of x limits for line plots is left to matplotlib, so that its new default settings are applied. (:issue:`15495`)
- Bug in ``Series.plot.bar`` or ``DataFramee.plot.bar`` with ``y`` not respecting user-passed ``color`` (:issue:`16822`)
- Bug in ``plotting._style._get_standard_colors`` resetting the random seed when generating random colors (:issue:`17525`)


Groupby/Resample/Rolling
Expand Down
1 change: 0 additions & 1 deletion pandas/plotting/_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def _get_standard_colors(num_colors=None, colormap=None, color_type='default',
import random

def random_color(column):
random.seed(column)
return [random.random() for _ in range(3)]

colors = lmap(random_color, lrange(num_colors))
Expand Down