d1713f4e92ec944246388c44fdd2b74675a103c0,examples/charts/file/boxplot.py,,,#,9

Before Change



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

// get the countries and group the data by medal type
countries = df.abbr.values.tolist()
gold = df["medals.gold"].astype(float).values
silver = df["medals.silver"].astype(float).values
bronze = df["medals.bronze"].astype(float).values

// build a dict containing the grouped data
medals = OrderedDict(bronze=bronze, silver=silver, gold=gold)

// any of the following commented are valid BoxPlot inputs
//medals = pd.DataFrame(medals)
//medals = list(medals.values())
//medals = tuple(medals.values())
//medals = np.array(list(medals.values()))

output_file("boxplot.html")

boxplot = BoxPlot(
    medals, marker="circle", outliers=True, title="boxplot test",
    xlabel="medal type", ylabel="medal count", width=800, height=600)

show(boxplot)

After Change


defaults.width = 350
defaults.height = 250

bar_plot = BoxPlot(df, label="cyl", values="mpg", title="label="cyl"")

// bar_plot2 = BoxPlot(df, label="cyl", bar_width=0.4, title="label="cyl" bar_width=0.4")
//
// bar_plot3 = BoxPlot(df, label="cyl", values="mpg", agg="mean",
//                 title="label="cyl" values="mpg" agg="mean"")
//
// bar_plot4 = BoxPlot(df, label="cyl", title="label="cyl" color="DimGray"", color="dimgray")
//
// // multiple columns
// bar_plot5 = BoxPlot(df, label=["cyl", "origin"], values="mpg", agg="mean",
//                 title="label=["cyl", "origin"] values="mpg" agg="mean"")
//
// bar_plot6 = BoxPlot(df, label="origin", values="mpg", agg="mean", stack="cyl",
//                 title="label="origin" values="mpg" agg="mean" stack="cyl"", legend="top_right")
//
// bar_plot7 = BoxPlot(df, label="cyl", values="displ", agg="mean", group="origin",
//                 title="label="cyl" values="displ" agg="mean" group="origin"", legend="top_right")

// ToDo: negative values
// bar_plot8 = Bar(df, label="cyl", values="neg_displ", agg="mean", group="origin", color="origin",
//                 title="label="cyl" values="displ" agg="mean" group="origin"", legend="top_right")


// collect and display
output_file("bar.html")

show(
    vplot(
        hplot(bar_plot)
    )
)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: bokeh/bokeh
Commit Name: d1713f4e92ec944246388c44fdd2b74675a103c0
Time: 2015-09-04
Author: nroth@dealnews.com
File Name: examples/charts/file/boxplot.py
Class Name:
Method Name:


Project Name: bokeh/bokeh
Commit Name: 3eaa24ad14989863c9e4d566463d5e0974cde5d1
Time: 2015-08-25
Author: nroth@dealnews.com
File Name: examples/charts/file/bar.py
Class Name:
Method Name:


Project Name: bokeh/bokeh
Commit Name: ded044ebee429e8e1b8dbd7e581bfb9634be7354
Time: 2015-09-08
Author: nroth@dealnews.com
File Name: examples/charts/file/lines.py
Class Name:
Method Name: