#201 Control the color of Treemap






This page aims to describe the customization you can apply on a treemap. You can easily change the color of each group using the following code:






import matplotlib.pyplot as plt
import squarify # pip install squarify (algorithm for treemap)

# Change color
squarify.plot(sizes=[13,22,35,5], label=["group A", "group B", "group C", "group D"], color=["red","green","blue", "grey"], alpha=.4 )

Leave a Reply

Your email address will not be published.