cd7a039d4c87544e19802643e08564a0fb954dac,examples/charts/file/stacked_bar.py,,,#,8

Before Change


from bokeh._legacy_charts import Bar, output_file, show
from bokeh.sampledata.olympics2014 import data

df = pd.io.json.json_normalize(data["data"])

// filter by countries with at least one medal and sort
df = df[df["medals.total"] > 0]

After Change


// filter by countries with at least one medal and sort
df = df[df["medals.total"] > 0]
df = df.sort("medals.total", ascending=False)
df = df.rename(columns={"medals.gold": "gold", "medals.silver": "silver",
                        "medals.bronze": "bronze", "medals.total": "total"})

bar = Bar(df,
          values=blend("bronze", "silver", "gold", name="medals", labels_name="medal"),
          label=cat(columns="abbr", sort=False),
          stack=cat(columns="medal", sort=False),
          color=color(columns="medal", palette=["SaddleBrown", "Silver", "Goldenrod"],
                      sort=False),
          legend="top_right",
          title="Stacked bars")

output_file("stacked_bar.html")
show(bar)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: bokeh/bokeh
Commit Name: cd7a039d4c87544e19802643e08564a0fb954dac
Time: 2015-10-13
Author: nlr06886@gmail.com
File Name: examples/charts/file/stacked_bar.py
Class Name:
Method Name:


Project Name: catalyst-cooperative/pudl
Commit Name: fdf7ce1ec10e77f0f54aed1c6c9fe65febaf7b67
Time: 2019-06-05
Author: zane.selvans@catalyst.coop
File Name: pudl/transform/ferc1.py
Class Name:
Method Name: plants_steam


Project Name: catalyst-cooperative/pudl
Commit Name: 51b96a4b946e00f2c5449a305149e153d0a2a1fd
Time: 2017-03-27
Author: cgosnell@catalyst.coop
File Name: pudl/eia923.py
Class Name:
Method Name: get_eia923_page


Project Name: deeptools/HiCExplorer
Commit Name: 10815f6494b5a01bba3c78bf78b7b3174f3ccfab
Time: 2017-10-18
Author: fidel.ramirez@gmail.com
File Name: hicexplorer/hicPrepareQCreport.py
Class Name:
Method Name: make_figure_pairs_used