Base.plotFeatureAgainstFeatureRollingAverage

Base.plotFeatureAgainstFeatureRollingAverage(x, y, sampleSizeForAverage=20, groupByFeature=None, trend=None, outPath=None, show=True, figureID=None, title=True, xAxisLabel=True, yAxisLabel=True, xMin=None, xMax=None, yMin=None, yMax=None, **kwargs)

A rolling average of the pairwise combination of feature values.

The points in the plot have coordinates defined by taking the average of pairwise values from x and y within a rolling window of length sampleSizeForAverage according to an ordering defined by the sorted values of x. Keyword arguments for matplotlib.pyplot’s plot function can be passed for further customization of the plot.

Control over the visual width of the both axes is given, with the warning that user specified values can obscure data that would otherwise be plotted given default inputs.

Parameters:
  • x (identifier) – The index or name of the feature from which we draw x-axis coordinates.

  • y (identifier) – The index or name of the feature from which we draw y-axis coordinates.

  • sampleSizeForAverage (int) – The number of samples to use for the calculation of the rolling average.

  • groupByFeature (identifier, None) – An optional index or name of the feature that divides the x and y values into groups. Each group will be plotted with a different color and a legend will be added. To use custom colors provide a dictionary of labels mapped to matplotlib color values as the ‘color’ keyword argument.

  • trend (str, None) – Specify a trendline type. Currently “linear” is the only supported string option. None will not add a trendline.

  • outPath (str, None) – A string of the path to save the current figure.

  • show (bool) – If True, display the plot. If False, the figure will not display until a plotting function with show=True is called. This allows for future plots to placed on the figure with the same figureID before being shown.

  • figureID (hashable, None) – A new figure will be generated for None or a new id, otherwise the figure with that id will be activated to draw the plot on the existing figure.

  • title (str, None) – The title of the plot. If True, the title will identify the two features presented in the plot.

  • xAxisLabel (str) – A label for the x axis. If True, the label will be “Values”.

  • yAxisLabel (str) – A label for the y axis. If True, the label will be “Number of Values”.

  • xMin (int, float) – The minimum value shown on the x axis of the resultant plot.

  • xMax (int, float) – The maximum value shown on the x axis of the resultant plot.

  • yMin (int, float) – The minimum value shown on the y axis of the resultant plot.

  • yMax (int, float) – The maximum value shown on the y axis of the resultant plot.

  • kwargs – Any keyword arguments accepted by matplotlib.pyplot’s plot function.

Keywords: graph, scatter, line, chart, relationship, figure, image, graphics, visualization