-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hi. Great and very useful package!
I am testing black/white text thresholds by using color_swatch(), but for some reason it gets nuts when using less than 9 colors.
In those cases, font sizes become huge and they don't fit inside colored boxes.
import distinctipy, matplotlib.pyplot as plt
colors = distinctipy.get_colors(8) # with less than 9 colors, color_swatch will use huge font sizes
thresholds = [0.4,0.6]
fig, axes = plt.subplots(len(thresholds), 1, figsize=(6, 6))
for i,t in enumerate(thresholds):
print(colors,"\n",textcolors)
distinctipy.color_swatch(colors, show_text=True, ax=axes[i], title="text_threshold={}".format(t), text_threshold=t)
plt.show()That code is for 8 colors.
I am using:
- python v. 3.8.7
- matplotlib v. 3.6.3
- distinctipy v. 1.2.3
This is my output for 2, 3, 8 and 9 colors:
2 colors:
3 colors:
8 colors:
9 colors:
Is there any way I can choose the font size to be used?
Thanks
@abubelinha
Metadata
Metadata
Assignees
Labels
No labels



