Scale the Chart
Scale is used to change the range of the chart, by default, the range of the plot is 100×100. Using norm_x you can scale x-axis data whereas norm_y you can scale the y-axis.
Python3
data = [ 100 , 20 , 50 , 1000 ] colors = [ "red" , "yellow" , "blue" , "green" ] squarify.plot(sizes = data, color = colors) |
Output:
Scaling with both axes.
Python3
data = [ 100 , 20 , 50 , 1000 ] colors = [ "red" , "yellow" , "blue" , "green" ] squarify.plot(sizes = data, norm_x = 1000 , norm_y = 10 , color = colors) |
Output:
Treemaps in Python using Squarify
Data Visualization is a powerful technique to analyze a large dataset through graphical representation. Python provides various modules that support the graphical representation of data. The widely used modules are Matplotlib, Seaborn, and Plotly. And we have one more module named Squarify which is mainly used to plot a Treemap.