trappy.plotter.StaticPlot module

Base matplotlib plotter module

class trappy.plotter.StaticPlot.StaticPlot(traces, templates, **kwargs)[source]

Bases: trappy.plotter.AbstractDataPlotter.AbstractDataPlotter

This class uses trappy.plotter.Constraint.Constraint to represent different permutations of input parameters. These constraints are generated by creating an instance of trappy.plotter.Constraint.ConstraintManager.

Parameters:
  • traces (a list of trappy.trace.FTrace, trappy.trace.SysTrace, trappy.trace.BareTrace or pandas.DataFrame or a single instance of them.) – The input data
  • column ((str, list(str))) – specifies the name of the column to be plotted.
  • templates (trappy.base.Base) –

    TRAPpy events

    Note

    This is not required if a pandas.DataFrame is used

  • filters (dict) –

    Filter the column to be plotted as per the specified criteria. For Example:

    filters =
            {
                "pid": [ 3338 ],
                "cpu": [0, 2, 4],
            }
    
  • per_line (int) – Used to control the number of graphs in each graph subplot row
  • concat (bool) – Draw all the pivots on a single graph
  • permute (bool) – Draw one plot for each of the traces specified
  • drawstyle

    This argument is forwarded to the matplotlib corresponding matplotlib.pyplot.plot() call

    drawing style.

    Note

    step plots are not currently supported for filled graphs

  • xlim (tuple) – A tuple representing the upper and lower xlimits
  • ylim (tuple) – A tuple representing the upper and lower ylimits
  • title (str) – A title describing all the generated plots
  • style (bool) – Created pre-styled graphs loaded from trappy.plotter.AttrConf.MPL_STYLE
  • signals (str) –

    A string of the type event_name:column to indicate the value that needs to be plotted

    Note

    • Only one of signals or both templates and columns should be specified
    • Signals format won’t work for pandas.DataFrame input
  • legend_ncol (int) – A positive integer that represents the number of columns in the legend
add_to_legend(series_index, handle, constraint, pivot, concat, permute)[source]

Add series handles and names to the legend A handle is returned from a plot on an axis e.g. Line2D from axis.plot()

make_title(constraint, pivot, permute, concat)[source]

Generates a title string for an axis

plot_axis(axis, series_list, permute, concat, args_to_forward)[source]

Internal Method called to plot data (series_list) on a given axis

savefig(*args, **kwargs)[source]

Save the plot as a PNG fill. This calls into matplotlib.figure.savefig

set_defaults()[source]

Sets the default attrs

view(test=False)[source]

Displays the graph