Changing text fontsize
In plotly, the labels can be remain of same size by using uniformtext layout parameter.The font size are set by minsize attributes, and mode attributes are set for labels cannot fit with the desired fontsize: either hide them or show them with overflow.
Python3
import plotly.graph_objects as go fig = go.Figure(go.Treemap( labels = [ "A" , "B" , "C" , "D" , "E" ], parents = [" ", " A ", " B ", " C ", " A"], marker_colors = [ "blue" , "pink" ] )) fig.update_layout(uniformtext = dict (minsize = 15 , mode = 'hide' )) fig.show() |
Output:
Treemap using graph_objects class in plotly
Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.