@@ -50,15 +50,15 @@ import datetime
5050from pathlib import Path
5151import plotly.express as px
5252import plotly.graph_objects as go
53- import plotly.io as pio
5453from plotly.subplots import make_subplots
5554from textwrap import dedent
56-
57- pio.renderers.default = "notebook"
5855from IPython.display import Markdown, display
5956import requests
6057from rich.progress import track
58+ import twoc
6159from twoc import colors
60+
61+ twoc.set_plotly_defaults()
6262```
6363
6464+++ {"editable": true, "slideshow": {"slide_type": ""}}
@@ -172,13 +172,7 @@ slideshow:
172172 slide_type: ''
173173tags: [remove-cell]
174174---
175- import pandas as pd
176- import pandas as pd
177- import plotly.express as px
178- import numpy as np
179175from plotly.express.colors import qualitative
180- import plotly.io as pio
181- pio.renderers.default = "notebook"
182176```
183177
184178``` {code-cell} ipython3
@@ -479,7 +473,7 @@ for i, scale in enumerate(scale_ordering, 1):
479473 fig_bins.update_xaxes(title_text=f"{scale.capitalize()} Active Users", tickangle=-45, row=1, col=i)
480474 fig_bins.update_yaxes(title_text="Number of communities", range=[0, max_y_bins], row=1, col=i)
481475fig_bins.update_layout(title_text="Number of communities in bins of active users", showlegend=False)
482- display( fig_bins)
476+ fig_bins.show( )
483477
484478# Create subplots for percentage breakdown
485479fig_perc = make_subplots(rows=1, cols=len(scale_ordering), subplot_titles=[s.capitalize() for s in scale_ordering])
@@ -500,7 +494,7 @@ for i, scale in enumerate(scale_ordering, 1):
500494 fig_perc.update_xaxes(title_text="Bin", tickangle=-45, row=1, col=i)
501495 fig_perc.update_yaxes(title_text="% of users", tickformat='.0%', range=[0, 1], row=1, col=i)
502496fig_perc.update_layout(title_text="% Total Active Users by community size", showlegend=False)
503- display( fig_perc)
497+ fig_perc.show( )
504498```
505499
506500### Date of First Value
0 commit comments