So I have the following code that generates a tree map in Matplotlib. Wondering if it's possible to have the first line emboldened and a larger font size .
So:
Emboldened and larger: 0:
Smaller and no emboldening: 480
import matplotlib.pyplot as plt
import squarify # pip install squarify (algorithm for treemap)
import pandas as pd
import psycopg2
distributionlist = [480, 104, 55, 35, 29, 12, 18, 22, 14, 11, 144]
group = ["0", "1", "2", "3", "4", "5", "6", "7","8","9","10+"]
labels = ["%s:\n%s" % (label) for label in zip(group, distributionlist)]
percents = [8,3,4,2,8,3,4,2]
# Create a data frame with fake data
df = pd.DataFrame({'nb_people': distributionlist, 'group':group })
#df = pd.DataFrame({'nb_people':[8,3,4,2], 'group':["group A", "group B", "group C", "group D"] })
# plot it
squarify.plot(sizes=df['nb_people'], label=labels, alpha=.8)
#squarify.plot(sizes=df['nb_people'], label=df['group'], alpha=.8 , color=colors )
plt.axis('off')
plt.show()