예제 #1
0
def importing_5():
    df = results.get_scalars("name =~ rxBytes:sum OR name =~ txBytes:sum",
                             include_runattrs=True)

    print(chart.extract_label_columns(df))
    df = pd.pivot_table(df, columns=["name", "replication"], index=["module"])
    print(df)
    chart.plot_scalars(df)
예제 #2
0
            max_y = max(q4_end, max_y)

        mid_y = (min_y + max_y) / 2
        # The y axis is rescaled to fit the new box plot completely with 10%
        # of the maximum value at both ends
        axes.set_ylim(
            [mid_y - (mid_y - min_y) * 1.25, mid_y + (max_y - mid_y) * 1.25])

    # If redraw is set to true, the canvas is updated.
    if redraw:
        axes.figure.canvas.draw()

    return box_plot


title, legend = chart.extract_label_columns(df)

df.sort_values(by=[l for i, l in legend], axis='index', inplace=True)

# This is how much of the standard deviation will give the 25th and 75th
# percentiles, assuming normal distribution.
# >>> math.sqrt(2) * scipy.special.erfinv(0.5)
coeff = 0.6744897501960817

customized_box_plot([(r.min, r.mean - r.stddev * coeff, r.mean,
                      r.mean + r.stddev * coeff, r.max)
                     for r in df.itertuples(index=False) if r.count > 0],
                    plt.gca())

if 'title' in df:
    plt.title(df[title][0])
예제 #3
0
params = chart.get_configured_properties()

if not (params["x_attr"] and params["y_attr"]):
    raise Exception("Please select axis attributes in the properties dialog!")

df = results.get_scalars(params["scalar_filter"],
                         include_attrs=True,
                         include_itervars=True,
                         include_runattrs=True)

df[params["x_attr"]] = pd.to_numeric(df[params["x_attr"]])
df[params["y_attr"]] = pd.to_numeric(df[params["y_attr"]])

#print(df)

title_col, legend_cols = chart.extract_label_columns(df)

print(legend_cols)
title = str(list(df[title_col])[0]) if title_col else None

df = pd.pivot_table(df,
                    columns=[params["x_attr"]],
                    index=params["y_attr"],
                    values="value",
                    dropna=False)

ax = plt.gcf().add_subplot(111, projection='3d')

print(df)

X, Y = np.meshgrid(df.columns, df.index)