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.
Sunburst Plot using graph_objects class
If Plotly Express does not render a good starting point, it is also accessible to custom from the more generic go.Sunburst class from plotly.graph_objects.The sunbrust is the prototype for exhibit hierarchical data.Each level of the hierarchy is represented by one ring or circle with the innermost circle as the top of the hierarchy.The sunbrust chart without any hierachical data looks similar to doughnut chart.
Syntax: class plotly.graph_objects.Sunburst(arg=None, branchvalues=None, count=None, customdata=None, hoverinfo=None, **kwargs)
arg: dict of properties compatible with this constructor or an instance of plotly.graph_objects.Sunburst
branchvalues: Determines how the items in values are summed.
count: Determines default for values when it is not provided, by inferring a 1 for each of the “leaves” and/or “branches”, otherwise 0.
customdata: Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements
hoverinfo: Determines which trace information appear on hover. If none or skip are set, no information is displayed upon hovering. But, if none is set, click and hover events are still fired.
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:
Presenting Large Number of Slices
In plotly, the sunbrust chart have several slices in its pie which helps to present the data more understandable and in efficient way, as each column of the data is separated through different colors.Various data slices can be built in a single pie which lead to take less space in layout.Lets see an example which is given below
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Sunburst Plot using Plotly in Python
- Box plot in Plotly using graph_objects class
- Scatter plot in Plotly using graph_objects class
- 3D Scatter Plot using graph_objects Class in Plotly-Python
- Plot Live Graphs using Python Dash and Plotly
- Scatter plot using Plotly in Python
- Pie plot using Plotly in Python
- Box Plot using Plotly in Python
- How to Create Stacked area plot using Plotly in Python?
- 3D scatter plot using Plotly in Python
- Parallel Coordinates Plot using Plotly in Python
- Carpet Contour Plot using Plotly in Python
- Ternary contours Plot using Plotly in Python
- How to create Grouped box plot in Plotly?
- PyQtGraph - Getting Plot Item from Plot Window
- Histograms in Plotly using graph_objects class
- Treemap using graph_objects class in plotly
- Create Heatmaps using graph_objects class in Plotly
- How to create a Ternary Overlay using Plotly?
- Python | Geographical plotting using plotly
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.