You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not necessarily an issue, but one can get some code improvement and consistency in pandas.plotting._matplotlib.style.get_standard_colors, when it is related to cycling colors.
During refactoring of the module (#37203) it turned out that cycling the colors works in a strange (although tolerable way).
From the snippets above one can see that in the second and third examples work reasonable.
Meanwhile, the first one returns three colors, rather than two.
Extra color(s) will be ignored anyway, but in regards to the discussion in the referenced PR, the way of cycling colors can be improved #37203 (comment)
Describe the solution you'd like
I suggest using matplotlib's cycler (or other generator) to cycle through the colors obtained and get the exact number of colors required, without any extra.
This will simplify the code involving colors cycling in get_standard_colors.
Is your feature request related to a problem?
Not necessarily an issue, but one can get some code improvement and consistency in
pandas.plotting._matplotlib.style.get_standard_colors
, when it is related to cycling colors.During refactoring of the module (#37203) it turned out that cycling the colors works in a strange (although tolerable way).
From the snippets above one can see that in the second and third examples work reasonable.
Meanwhile, the first one returns three colors, rather than two.
Extra color(s) will be ignored anyway, but in regards to the discussion in the referenced PR, the way of cycling colors can be improved #37203 (comment)
Describe the solution you'd like
I suggest using matplotlib's cycler (or other generator) to cycle through the colors obtained and get the exact number of colors required, without any extra.
This will simplify the code involving colors cycling in
get_standard_colors
.Expected Output
API breaking implications
Will break some tests related to
get_standard_colors
only as they expect extra colors to be returned on some occasions.Describe alternatives you've considered
See #37203 without involving modifications to color cycling.
The text was updated successfully, but these errors were encountered: