trappy.plotter.ILinePlotGen module

This is helper module for trappy.plotter.ILinePlot for adding HTML and javascript necessary for interactive plotting. The Linear to 2-D co-ordination transformations are done by using the functionality in trappy.plotter.PlotLayout

class trappy.plotter.ILinePlotGen.ILinePlotGen(num_plots, **kwargs)[source]

Bases: object

Parameters:num_plots (int) – The total number of plots

The linear co-ordinate system \([0, N_{plots}]\) is mapped to a 2-D coordinate system with \(N_{rows}\) and \(N_{cols}\) such that:

\[N_{rows} = \frac{N_{cols}}{N_{plots}}\]
add_plot(plot_num, data_frame, title='', test=False)[source]

Add a plot for the corresponding index

Parameters:
  • plot_num (int) – The linear index of the plot
  • data_frame (pandas.DataFrame) – The data for the plot
  • title (str) – The title for the plot
finish()[source]

Called when the Plotting is finished

html()[source]

Return the raw HTML text

trappy.plotter.ILinePlotGen.df_to_dygraph(data_frame)[source]

Helper function to convert a pandas.DataFrame to dygraph data

Parameters:data_frame (pandas.DataFrame) – The DataFrame to be converted