I have a treemap that has small enough sections that the labels overlap. Is there any way to move the labels for sections under size=4 (or something around that) to either outside of the plot with an arrow pointing to it, or into a small legend only containing the labels for the small portions?
The treemap generated and code is below.
import squarify #pip install squarify
import matplotlib.pyplot as plt
labels=["longlabel1","longlabel2","longlabel3","longlabel4","longlabel5","longlabel6","longlabel7","longlabel8","longlabel9","longlabel10","longlabel11","longlabel12",]
sizes=[1.8,1.3,10.5,13.8,7.8,6.7,9.9,12.2,12.7,10.9,7.6,4.8]
x=dict(zip(labels,sizes))
sortedDict=dict(sorted(x.items(),key=lambda item:item[1],reverse=True))
squarify.plot(sizes=list(sortedDict.values()),color=['red','blue','cyan','black','gray','green'],label=list(iter(sortedDict)),alpha=.8)
plt.axis('off')
plt.show