bar chart race python

Solutions on MaxInterview for bar chart race python by the best coders in the world

showing results for - "bar chart race python"
Davide
27 Mar 2020
1import bar_chart_race as bcr
2df = bcr.load_dataset('covid19_tutorial')
3bcr.bar_chart_race(
4    df=df,
5    filename='covid19_horiz.mp4',
6    orientation='h',
7    sort='desc',
8    n_bars=6,
9    fixed_order=False,
10    fixed_max=True,
11    steps_per_period=10,
12    interpolate_period=False,
13    label_bars=True,
14    bar_size=.95,
15    period_label={'x': .99, 'y': .25, 'ha': 'right', 'va': 'center'},
16    period_fmt='%B %d, %Y',
17    period_summary_func=lambda v, r: {'x': .99, 'y': .18,
18                                      's': f'Total deaths: {v.nlargest(6).sum():,.0f}',
19                                      'ha': 'right', 'size': 8, 'family': 'Courier New'},
20    perpendicular_bar_func='median',
21    period_length=500,
22    figsize=(5, 3),
23    dpi=144,
24    cmap='dark12',
25    title='COVID-19 Deaths by Country',
26    title_size='',
27    bar_label_size=7,
28    tick_label_size=7,
29    shared_fontdict={'family' : 'Helvetica', 'color' : '.1'},
30    scale='linear',
31    writer=None,
32    fig=None,
33    bar_kwargs={'alpha': .7},
34    filter_column_colors=False)  
35