Answers for "Simple Example to Plot Python Treemap with lables and colors"

0

Simple Example to Plot Python Treemap with lables and colors

import matplotlib.pyplot as plt
import squarify
import pandas as pd

square_sizes=[10, 40, 20, 70]
labels=["10", "40", "20", "70"]
colors=['purple','orange','blue','green']
squarify.plot(sizes=square_sizes, label=labels, color=colors, alpha=0.6 )
plt.axis('off')
plt.show()
Posted by: Guest on December-28-2021

Python Answers by Framework

Browse Popular Code Answers by Language