본문 바로가기
Python Library/HeartPy

[HeartPy] Colorblind mode (2)

by goatlab 2022. 8. 25.
728x90
반응형
SMALL

Colorblind mode

 

# Now let's do colorblind protanopia friendly palettes
hp.config.colorblind = True
hp.config.colorblind_type = 'tritanopia'

for palette in palettes:
    hp.config.color_style = palette
    hp.plot_poincare(wd, m, title='color palette: %s' %palette)

 

import matplotlib.pyplot as plt

data, timer = hp.load_exampledata(1)
fs = hp.get_samplerate_mstimer(timer)

wd, m = hp.process(data, 100.0, clean_rr = True)

hp.config.colorblind = False
hp.config.color_style = 'default'

plt.figure(figsize=(12,6))
hp.plotter(wd, m)

hp.config.colorblind = False

for palette in palettes:
    hp.config.color_style = palette
    
    plt.figure(figsize=(12,4))
    hp.plotter(wd, m, title='palette: %s' %palette)

hp.config.colorblind = True
hp.config.colorblind_type = 'Deuteranopia'

for palette in palettes:
    hp.config.color_style = palette
    
    plt.figure(figsize=(12,4))
    hp.plotter(wd, m, title='palette: %s' %palette)

hp.config.colorblind = True
hp.config.colorblind_type = 'protanopia'

for palette in palettes:
    hp.config.color_style = palette
    
    plt.figure(figsize=(12,4))
    hp.plotter(wd, m, title='palette: %s' %palette)

hp.config.colorblind = True
hp.config.colorblind_type = 'tritanopia'

for palette in palettes:
    hp.config.color_style = palette
    
    plt.figure(figsize=(12,4))
    hp.plotter(wd, m, title='palette: %s' %palette

 

https://github.com/paulvangentcom/heartrate_analysis_python/blob/master/examples/6_colorblind_mode/Colorblind_mode.ipynb

 

GitHub - paulvangentcom/heartrate_analysis_python: Python Heart Rate Analysis Package, for both PPG and ECG signals

Python Heart Rate Analysis Package, for both PPG and ECG signals - GitHub - paulvangentcom/heartrate_analysis_python: Python Heart Rate Analysis Package, for both PPG and ECG signals

github.com

 

728x90
반응형
LIST