Skip to content

Commit

Permalink
GitBook: [master] 71 pages and 4 assets modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivy authored and gitbook-bot committed Jul 23, 2020
1 parent 067a63d commit 8cbd3c7
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 3 deletions.
Binary file added .gitbook/assets/animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* [6.1 Fundamental Concepts](plotly/6.1-fundamental-concepts/README.md)
* [6.1.1 Plotly Express](plotly/6.1-fundamental-concepts/6.1.1-plotly-express.md)
* [6.1.2 Plotly Graph Objects](plotly/6.1-fundamental-concepts/6.1.2-plotly-graph-objects.md)
* [6.2 Basic Charts](plotly/6.2-basic-charts/README.md)
* [6.2 Advanced Charts](plotly/6.2-basic-charts/README.md)
* [6.2.1 Advanced Scatter Chart](plotly/6.2-basic-charts/6.2.1-advanced-scatter-chart.md)
* [6.2.2 Advanced Bar Chart](plotly/6.2-basic-charts/6.2.2-advanced-bar-chart.md)
* [6.2.3 Advanced Pie Chart](plotly/6.2-basic-charts/6.2.3-advanced-pie-chart.md)
Expand Down
62 changes: 62 additions & 0 deletions plotly/6.2-basic-charts/6.2.1-advanced-scatter-chart.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
# 6.2.1 Advanced Scatter Chart

### 1. Bubble Chart with Colorbar

```text
fig = go.Figure(data=go.Scatter(
y = np.random.randn(500),mode='markers',
marker=dict(
size=24,
color=np.random.randn(500), #set color equal to a variable
colorscale='RdBu', # one of plotly colorscales
showscale=True)
))
fig.update_layout(template= 'plotly_dark')
fig.show()
```

![ Bubble Chart with Colorbar](../../.gitbook/assets/screenshot-2020-07-23-at-14.30.36.png)

### 2. Bubble Charts with Colorscale

```text
fig = go.Figure(data=[go.Scatter(
x=[1, 3.2, 5.4, 7.6, 9.8, 12.5],
y=[1, 3.2, 5.4, 7.6, 9.8, 12.5],
mode='markers',
marker=dict(
color=[100, 110, 125, 155, 175, 210],
size=[30, 40, 50, 70, 80, 100],
colorscale='matter', # one of plotly colorscales
showscale=True )
)])
fig.update_layout(template= 'none') # let's try a new template
fig.show()
```

![Bubble Chart with Colorscale](../../.gitbook/assets/screenshot-2020-07-23-at-16.51.08.png)

### 3. Bubble chart

```text
df = px.data.gapminder()
fig = px.scatter(df.query("year==2007"), x="gdpPercap", y="lifeExp", size="pop", color="continent",
hover_name="country", log_x=True, size_max=80)
fig.show()
```

![Sophiscated Bubble Chart](../../.gitbook/assets/screenshot-2020-07-23-at-16.40.21.png)

### 4. Bubble Chart Animation

```text
fig = px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year",
animation_group="country", size="pop", color="continent",
hover_name="country", facet_col="continent",
log_x=True, size_max=60, range_x=[100,100000], range_y=[40,90])
fig.show()
```

![Bubble Chart with animation](../../.gitbook/assets/animation.gif)



2 changes: 1 addition & 1 deletion plotly/6.2-basic-charts/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# 6.2 Basic Charts
# 6.2 Advanced Charts

2 changes: 1 addition & 1 deletion plotly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ conda install -c plotly plotly=4.9.0 # conda installation
* [6.1 Fundamental Concepts](6.1-fundamental-concepts/)
* [6.2 Basic Charts](6.2-basic-charts/)
* [6.3 Statistical Charts](6.3-statistical-charts.md)
* [6.5 Financial Charts](6.5-financial-charts.md)
* [6.4 Financial Charts](6.5-financial-charts.md)

0 comments on commit 8cbd3c7

Please sign in to comment.