def bin_test(): print('normal distribution, 3 bins') out = audioplot.plot('histogram') data = np.random.normal(size=1000000, loc=0, scale=1) out.data(data) out.bins(3) out.play()
def duration_test(): print('testing shorter duration of 2 seconds') out = audioplot.plot('line') data_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] out.data(data_array) out.duration(2) out.play()
def linear_range_test(): print('a linear line with adjusted audio range') data_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] out = audioplot.plot('line') out.data(data_array) out.audio_range(200, 250) out.play()
def bar_test(): print('bar chart with default settings') data_items = ['car','bicycle','bus'] data_values=[20,10,5] out = audioplot.plot('bar') out.data(data_values,data_items) out.play()
def rate_test(): print('a bar chart with increased speaking rate') data_items = ['car','bicycle','bus'] data_values=[20,10,5] out = audioplot.plot('bar') out.data(data_values,data_items) out.rate('400' ) out.play()
def range_test(): print('normal distribution with adjusted frequencies') out = audioplot.plot('histogram') data = np.random.normal(size=1000000, loc=0, scale=1) out.data(data) out.bins(3) out.audio_range(200, 350) out.play()
def verbose_test(): print('a bar chart with verbose output') data_items = ['car','bicycle','bus'] data_values=[20,10,5] out = audioplot.plot('bar') out.data(data_values,data_items) out.verbosity(True) out.title('A bar chart of the number of people that take different modes of transport') out.play()
def verbose_test(): out = audioplot.plot('histogram') print('normal distribution with verbose True') data = np.random.normal(size=1000000, loc=0, scale=1) out.data(data) out.bins(3) out.verbosity(True) out.title('A normal distribution with 1,000,000 data points') out.play()
def verbose_test(): print('testing verbose output') out = audioplot.plot('line') data_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] out.data(data_array) out.verbosity(True) out.title('A linearly rising line') out.xlabel('time period') out.ylabel('amount of an item') out.play()
def single_array_input_test(): out = audioplot.plot('line') data_array = [1, 3] out.data(data_array, smoothed=True) out.play()
def linear_test(): print('a linear line with no smoothing') data_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] out = audioplot.plot('line') out.data(data_array) out.play()
def exponential_test(): print('an exponential line') data_array = np.logspace(2, 9, dtype='int') out = audioplot.plot('line') out.data(data_array) out.play()
def straight_test(): print('a straight line') data_array = [1, 1, 1, 1, 1] out = audioplot.plot('line') out.data(data_array) out.play()
def normal_test(): print('normal distribution, default settings') out = audioplot.plot('histogram') data = np.random.normal(size=1000000, loc=0, scale=1) out.data(data) out.play()