calpy.plots package¶
Submodules¶
calpy.plots.plots module¶
-
calpy.plots.plots.
all_profile_plot
(file_name, features=['waveform', 'mfcc', 'pitch', 'intensity', 'pitch_hist', 'dB'], num_plots=200, num_chunks=10, scaling=4, print_status=False)[source]¶ Plots a multirow plot of various features.
- Args:
- filename (str): path to the audio file. features (list(string)): list of features to be plotted. Ignores nonexistent features. Defaults to [“waveform”, “mfcc”, “pitch”, “intensity”, “pitch_hist”, “dB”] num_plots (int): divide the intial wavform into num_plots pieces and create one plot each. Defaults to 200. num_chunks (int): number of subdivisions of one plot. Defaults to 10. scaling (int): scales the size of the output plot.
- Returns:
- null: saves plots to a folder in current directory.
-
calpy.plots.plots.
export
(bokeh_plot, file_path, astype='png')[source]¶ Save a plot as picture file.
- Args:
- bokeh_plot (bokeh plot object): The plot object to be saved. file_path (str): Where to save the picture. astype (str, optional): The file type. Defaults to png, another option is svg.
- Return
- null: Outputs a plot to a file.
-
calpy.plots.plots.
feature_distribution
(features, output_file, bins=100, showfig=False, savefig=True)[source]¶ Plot histogram of features Args:
features (numpy.array): 1D or 2D feature vector. If 2D, features are along axis 1. output_file (string): path to output figure. bins (int, optional): number of bins, defaults to 100. showfig (bool, optional): True indicates to plot out the figure. Defaults to False. savefig (bool, optional): True indicates to write the figure to disk. Defaults to True.- Returns:
- None, save a figure to output_file or show a figure if showfig.
-
calpy.plots.plots.
mfcc_plot
(AA, file_name='', figsize=(16, 4))[source]¶ Plots points on the plane and connects with a line.
- Args:
- AA (numpy.array(floats)): 2D array containing the MFCC. file_name (str, optional): Outputs picture to this file_name. Defaults to empty. figsize (tuple(float,float), optional): A tuple specifying (width, height) in inches of plot. Defaults to (16,4)
- Returns:
- null : Saves an image to file_name else displays to default plot
-
calpy.plots.plots.
profile_plot
(ys, xlabel='', ylabel='', file_name='', figsize=(8, 4), remove_zeros=False)[source]¶ Plots points on the plane and connects with a line.
- Args:
- ys (numpy.array(floats)): List of numeric values to be plotted. xlabel (str, optional): The name for the x-axis. Defaults to emtpy. ylabel (str, optional): The name for the y-axis. Defaults to emtpy. file_name (str, optional): Outputs picture to this file_name. Defaults to empty. figsize (tuple(float,float), optional): A tuple specifying (width, height) in inches of plot. Defaults to (8,4) remove_zeros (bool, optional): Toggle for replacing 0s with NANs. Defaults to False.
- Returns:
- null : Saves an image to file_name else displays to default plot
-
calpy.plots.plots.
recurrence
(AA, ID=array([], dtype=int64), colours=['red', 'blue', 'green'])[source]¶ Plots a recurrence plot.
- Args:
- AA (numpy.array(float)): A 2D reccurence matrix. ID (numpy.array(int), optional): A vector so that speaker( col[i] ) = ID[i]. Defaults to the 0 vector. colours (list(str), optional): Colours for the plot.
- Returns:
- bokeh plot object