The contents of this page have been taken over by the new project.


audio-plot examples

Example 1 : Two inverted sinusoidal data

Data

  
sin = np.sin(np.arange(0, np.pi*2, 0.1))  # 0,  0.09983342,  0.19866933,  0.29552021,  0.38941834, ...
two_inverted_sin = np.array([sin, -1 * sin]).T
  

Line Graph

two inverted sinusoidal data graph

Audio Plot

Case 1

  
audio_plot.plot(two_inverted_sin)
  

Case 2

  
audio_plot.plot(two_inverted_sin, ptype="overlay")
  

Case 3

  
audio_plot.plot(two_inverted_sin, duration=200, min_freq=130.813/2, max_freq=130.813*3, labels=["A", "B"])
  

Example 2 : COVID-19 deaths data in U.S.

Data

  
df = pd.read_csv("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv")
new_york = df[(df.state == "New York") & (df.date > "2020-03-01")].deaths.values
texas = df[(df.state == "Texas") & (df.date > "2020-03-01")].deaths.values

new_york_and_texas_death_since_march = np.array([new_york, texas]).T
  

Line Graph

covid-19 deaths data graph

Audio Plot

  
audio_plot.plot(new_york_and_texas_death_since_march, labels=["new york", "texas"])