Add simple time series plotting function
See original GitHub issueHey,
I just thought of adding a little helper function to the display
module which simply plots a time series.
Basically a plt.plot()
but uses the librosa.display.TimeFormatter
. I have this already as a helper function and it comes in handy in times where you might have 1d-features with different sampling rate and want to compare them…whatever, no big deal. Is this interesting as a general function?
Code
import numpy as np
import matplotlib.pyplot as plt
import librosa
import librosa.display
sr = 10
x = np.random.rand(100)
plt.figure(figsize=(10, 6))
times = librosa.samples_to_time(np.arange(len(x)), sr=sr)
plt.plot(times, x)
plt.gca().xaxis.set_major_formatter(librosa.display.TimeFormatter(lag=False))
plt.gca().xaxis.set_label_text('Time')
plt.show()
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Plotting Time Series Data
The plotting of time series object is most likely one of the steps of the analysis of time-series data. The \code{ is a...
Read more >How to Plot a Time Series in Matplotlib? - GeeksforGeeks
We need to have two axes for our graph i.e X and Y-axis. We will start by having a dataframe to plot the...
Read more >Basic Time Series Plotting | Unidata Python Training
To learn about time series analysis, we first need to find some data and get it into Python. In this case we're going...
Read more >Time Series Data Visualization with Python
Visualization plays an important role in time series analysis and forecasting. Plots of the raw sample data can provide valuable diagnostics ...
Read more >How to Plot a Time Series in R (With Examples) - Statology
This tutorial explains how to plot a time series in R, including several examples.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I propose that this feature be rolled into #1207
Color-code the waveform according to a perceptual audio feature (e.g. spectral brightness à la Traktor) and you’ve got a unique viz in the Pythonic landscape here ☺️