Created
October 6, 2020 13:45
-
-
Save macleginn/8fc4e827c670ddb99e39c8794ab5c71e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
d = pd.read_excel('spectrograms-relative-20.xlsx', header=None) | |
# Combine the first two columns in a new index | |
index_col = [ f'{a}-{b}' for a, b in zip(d.iloc[:,0], d.iloc[:,1]) ] | |
d.index = index_col | |
# Delete old index columns | |
del d[0] | |
del d[1] | |
plt.figure(figsize = (16, 55)) | |
for i, word in enumerate(d.index[:30]): | |
plt.tight_layout() | |
plt.subplot(30, 1, i+1) | |
plt.tick_params( | |
axis='x', # changes apply to the x-axis | |
which='both', # both major and minor ticks are affected | |
bottom=False, # ticks along the bottom edge are off | |
top=False, # ticks along the top edge are off | |
labelbottom=False) # labels along the bottom edge are off | |
# One row per plot | |
plt.plot(d.iloc[i,:]) | |
plt.title(word) | |
plt.savefig('lineplottest.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment