I'm trying to make a treemap with squarify with some squares much bigger than the others.
title | counts | labels |
---|---|---|
A | 100 | A - 100 |
B | 30 | B - 30 |
C | 25 | C - 25 |
D | 2 | D - 2 |
E | 2 | E - 2 |
F | 2 | F - 2 |
G | 2 | G - 2 |
fig, ax = plt.subplots(1, figsize = (12,12))
ax = squarify.plot(sizes=df['counts'],
label=df['labels'],
alpha=0.5)
plt.axis('off')
plt.show()
Is there a way to make the font size of A as big as its square size, font B smaller than A, font C a bit smaller than B, and the rest very small?
I found a parameter:
text_kwargs={'fontsize':10}
But it doesn't allow me to insert a list of sizes.