CovertMark.data.plot module
- CovertMark.data.plot.plot_hist(lengths, x_name, y_name, show=True, img_out=None, title=None, bin_width=10)[source]
Given a list of TCP payload lengths (or some other kind of 1D data), plot a historam showing the distribution of these payload lengths.
- Parameters
lengths (list) – a list of integer payload lengths.
x_name (str) – the name of the x-axis property.
y_name (str) – the name of the y-axis property.
show (bool) – if True, show the plot through a GUI interface.
img_out (str) – if set, output the plot to the path specified.
title (str) – if set, display the title as specified in string.
bin_width (int) – if set decides the width of bins, 10 by default.
- Returns
True if plot successfully, False otherwise.
- CovertMark.data.plot.plot_performance(csvs_in, names, x_name, y_name, show=True, img_out=None, title=None)[source]
Given CSVs containing the same x-axis and y-axis properties, and roduce curves with errorbars containing these information.
- Parameters
csvs_in (list) – input CSVs, each must contain all information above in unique columns.
names (str) – list of strings giving legend of the lines plotted, must match the length of csvs_in.
x_name (str) – the name of the shared x-axis property.
y_name (str) – the name of the shared y-axis property.
show (bool) – if True, show the plot through a GUI interface.
img_out (str) – if set, output the plot to the path specified.
title (str) – if set, display the title as specified in string.
- Returns
True if plot successfully, False otherwise.
- CovertMark.data.plot.to_percent(y, position)[source]
Percentage label formatter from matplotlib. Taken from https://matplotlib.org/examples/pylab_examples/histogram_percent_demo.html.