Showing Branchvalues
With branchvalues “total”, the value of parent to represent the width of the wedge. With branchvalues “remainder”, the parent width is demarcate by its own values plus the value of children.The sum of the children cannot exceed to the sum of the parent when the branch values are set to be “total”.Lets see an example to get know more about it, shown below:
Example:
Python3
import plotly.graph_objects as go fig = go.Figure(go.Sunburst( labels = [ "A" , "B" , "C" , "D" , "E" , "F" , "G" , "H" , "I" ], parents = [" ", " A ", " A ", " C ", " C ", " A ", " A ", " G ", " A" ], values = [ 11 , 24 , 2 , 6 , 7 , 1 , 1 , 5 , 4 ], branchvalues = "remainder" , )) fig.update_layout(margin = dict (t = 0 , l = 0 , r = 0 , b = 0 )) fig.show() |
Output:
Sunburst Plot 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.