trappy.plotter.LinePlot module

This class sublclasses trappy.plotter.StaticPlot.StaticPlot to implement a line plot.

class trappy.plotter.LinePlot.LinePlot(traces, templates=None, **kwargs)[source]

Bases: trappy.plotter.StaticPlot.StaticPlot

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
  • fill (bool) – Fill the area under the plots
  • 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. You can add an additional parameter to specify the color of the lin in rgb: “event_name:column:color”. The color is specified as a comma separated list of rgb values, from 0 to 255 or from 0x0 to 0xff. E.g. 0xff,0x0,0x0 is red and 100,40,32 is brown.

    Note

    • Only one of signals or both templates and columns should be specified
    • Signals format won’t work for pandas.DataFrame input
fill_line(axis, line_2d, cmap_index)[source]

Fill the area under a line

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

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

set_defaults()[source]

Sets the default attrs