Skip to content

Commit 7e2042f

Browse files
committed
Fix bar_plot colour exhaustion for > 50 levels
1 parent fb35e4d commit 7e2042f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/toplot/weights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def bar_plot(
257257

258258
# Give each category set (=first column level) a different colour.
259259
multinomial_names = dataframe.columns.unique(level=0)
260-
repeated_colours = 5 * tuple(TABLEAU_COLORS) # Five times should suffice.
260+
repeated_colours = cycle(TABLEAU_COLORS)
261261
colour_of_multinomial = dict(zip(multinomial_names, repeated_colours))
262262
colours = [
263263
colour_of_multinomial[name] for name in dataframe.columns.get_level_values(0)

0 commit comments

Comments
 (0)