Skip to content

Update description for sunburst basic example #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions python/sunburst-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.6.8
version: 3.7.3
plotly:
description: How to make Sunburst Charts.
display_as: basic
has_thumbnail: true
ipynb: ~notebook_demo/274/
language: python
layout: user-guide
layout: base
name: Sunburst Charts
order: 6.1
page_type: u-guide
Expand All @@ -37,6 +37,13 @@ jupyter:
---

### Basic Sunburst Plot ###
Sunburst plot visualizes hierarchical data spanning outwards radially from root to leaves. The sunburst sectors are determined by the entries in "labels" and in "parents". The root starts from the center and children are added to the outer rings.

Main arguments:
1. **labels**: sets the labels of sunburst sectors.
2. **parents**: sets the parent sectors of sunburst sectors. An empty string '' is used for the root node in the hierarchy. In this example, the root is "Eve".
3. **values**: sets the values associated with sunburst sectors, determining their width (See the "Branchvalues" section below for different modes for setting the width).


```python
import plotly.graph_objects as go
Expand All @@ -46,6 +53,8 @@ fig =go.Figure(go.Sunburst(
parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ],
values=[10, 14, 12, 10, 2, 6, 6, 4, 4],
))
# Update layout for tight margin
# See https://plot.ly/python/creating-and-updating-figures/
fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))

fig.show()
Expand Down