Skip to content

Instantly share code, notes, and snippets.

@czming
Last active August 28, 2022 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czming/6f188498391900f081a16f6fec91711c to your computer and use it in GitHub Desktop.
Save czming/6f188498391900f081a16f6fec91711c to your computer and use it in GitHub Desktop.
Visualizes pre-filtered and filtered data #aits
# columns in the data that you want to visualize (visualize each column's value along the rows, where the row number is the x-axis)
VISUALIZED_COLUMNS = [0, -1, -2, -3, -4]
# show visualization of data, change to only one column (second argument) if only want to visualize current set of data instead of contrasting pre- vs post-filtering
fig, axs = plt.subplots(len(VISUALIZED_COLUMNS), 2)
for i, column in enumerate(VISUALIZED_COLUMNS):
old_data = data[:, column]
# plot pre-filtered data
axs[i, 0].plot(range(len(data)), old_data)
# convolved_data is the data that has been filtered
filtered_data = convolved_data[:, column]
axs[i, 1].plot(range(len(data)), filtered_data)
axs[0, 0].set_title("Original data")
axs[0, 1].set_title("Filtered data")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment