Base.plotFeatureDistribution

Base.plotFeatureDistribution(feature, outPath=None, show=True, figureID=None, title=True, xAxisLabel=True, yAxisLabel=True, xMin=None, xMax=None, **kwargs)

Plot a histogram of the distribution of values in a feature.

Along the x axis of the plot will be the values seen in the feature, grouped into bins; along the y axis will be the number of values in each bin. Bin width is calculated using Freedman-Diaconis’ rule. Control over the width of the x axis is also given, with the warning that user specified values can obscure data that would otherwise be plotted given default inputs.

Parameters:
  • feature (identifier) – The index of name of the feature to plot.

  • 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 feature presented in the distribution.

  • 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.

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

Keywords: histogram, chart, figure, image, graphics, kde, density, probability density function, visualization