trappy.plot_utils module

Small functions to help with plots

trappy.plot_utils.normalize_title(title, opt_title)[source]

Return a string with that contains the title and opt_title if it’s not the empty string

See test_normalize_title() for usage
trappy.plot_utils.number_freq_plots(runs, map_label)[source]

Calculate the number of plots needed for allfreq plots and frequency histogram plots

trappy.plot_utils.plot_allfreqs(runs, map_label, width=None, height=None)[source]

Make a multicolumn plots of the allfreqs plots of each run

trappy.plot_utils.plot_controller(runs, width=None, height=None)[source]

Make a multicolumn plot of the pid controller of each run

trappy.plot_utils.plot_freq_hists(runs, map_label)[source]

Plot frequency histograms of multiple runs

trappy.plot_utils.plot_hist(data, ax, title, unit, bins, xlabel, xlim, ylim)[source]

Plot a histogram

trappy.plot_utils.plot_input_power(runs, actor_order, width=None, height=None)[source]

Make a multicolumn plot of the input power of each run

trappy.plot_utils.plot_load(runs, map_label, width=None, height=None)[source]

Make a multiplot of all the loads

trappy.plot_utils.plot_output_power(runs, actor_order, width=None, height=None)[source]

Make a multicolumn plot of the output power of each run

trappy.plot_utils.plot_temperature(runs, width=None, height=None, ylim='range', tz_id=None)[source]

Plot temperatures

runs is an array of FTrace() instances. Extract the control_temp from the governor data and plot the temperatures reported by the thermal framework. The governor doesn’t track temperature when it’s off, so the thermal framework trace is more reliable.

trappy.plot_utils.plot_temperature_hist(runs)[source]

Plot temperature histograms for all the runs

trappy.plot_utils.plot_weighted_input_power(runs, actor_order, width=None, height=None)[source]

Make a multicolumn plot of the weighted input power of each run

trappy.plot_utils.post_plot_setup(ax, title='', xlabel=None, ylabel=None, xlim='default', ylim='range')[source]

Set xlabel, ylabel title, xlim and ylim of the plot

This has to be called after calls to .plot(). The default ylim is to extend it by 10% because matplotlib default makes it hard values that are close to the margins

trappy.plot_utils.pre_plot_setup(width=None, height=None, ncols=1, nrows=1)[source]

initialize a figure

width and height are the height and width of each row of plots. For 1x1 plots, that’s the height and width of the plot. This function should be called before any calls to plot()

trappy.plot_utils.set_lim(lim, get_lim_f, set_lim_f)[source]

Set x or y limitis of the plot

lim can be a tuple containing the limits or the string “default” or “range”. “default” does nothing and uses matplotlib default. “range” extends the current margin by 10%. This is useful since the default xlim and ylim of the plots sometimes make it harder to see data that is just in the margin.

trappy.plot_utils.set_xlim(ax, xlim)[source]

Set the xlim of the plot

See set_lim() for the details

trappy.plot_utils.set_ylim(ax, ylim)[source]

Set the ylim of the plot

See set_lim() for the details