-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add subcoordinate_y
keyword
#1379
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1379 +/- ##
==========================================
+ Coverage 88.87% 88.89% +0.02%
==========================================
Files 51 51
Lines 7478 7494 +16
==========================================
+ Hits 6646 6662 +16
Misses 832 832 ☔ View full report in Codecov by Sentry. |
Looks pretty good! Codeimport numpy as np
import pandas as pd
from pathlib import Path
import mne
import colorcet as cc
from hvplot import pandas
hv.extension('bokeh')
# data from https://datasets.holoviz.org/eeg/v1/S001R04.edf
data_path =
raw = mne.io.read_raw_edf(data_path, preload=True)
raw.set_eeg_reference("average")
raw.rename_channels(lambda s: s.strip("."));
df = raw.to_data_frame()
df.set_index('time', inplace=True)
df.hvplot(subcoordinate_y={'subcoordinate_scale':4}, responsive=True, min_height=700, legend=False, color='black', line_width=1) Known issues: Nice to haves eventually:
entries = df.columns.tolist()
colors = cc.b_glasbey_bw
letter_to_color = {letter: colors[i % len(colors)] for i, letter in enumerate(sorted(set(e[0] for e in entries)))}
entry_to_color = {entry: letter_to_color[entry[0]] for entry in entries}
df.hvplot(subcoordinate_y={'subcoordinate_scale':4}, responsive=True, min_height=700, legend=False, line_width=1, cmap=entry_to_color) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made a couple of minor changes
Closes #1160