Closed raphaelvallat closed 4 years ago
The following snippet can be used to plot a transition matrix probs obtained with the yasa.transition_matrix function:
probs
grid_kws = {"height_ratios": (.9, .05), "hspace": .1} f, (ax, cbar_ax) = plt.subplots(2, gridspec_kw=grid_kws, figsize=(5, 5)) sns.heatmap(probs, ax=ax, square=False, vmin=0, vmax=1, cbar=True, cbar_ax=cbar_ax, cmap='YlOrRd', annot=True, fmt='.2f', cbar_kws={"orientation": "horizontal", 'fraction': 0.1, 'label': 'Transition probability'}) ax.set_xlabel("To sleep stage") ax.xaxis.tick_top() ax.set_ylabel("From sleep stage") ax.xaxis.set_label_position('top')
For now, I will not implement it in YASA as it would require adding Seaborn as a dependency
Added example in API documentation: https://github.com/raphaelvallat/yasa/commit/988972c9c00213bd82598ab0f90eeae7090eba5b
The following snippet can be used to plot a transition matrix
probs
obtained with the yasa.transition_matrix function:For now, I will not implement it in YASA as it would require adding Seaborn as a dependency