Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Apr 7, 2020
1 parent 5cb521a commit 4a80b4b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
10 changes: 6 additions & 4 deletions docs/build/html/_modules/yasa/sleepstats.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ <h1>Source code for yasa.sleepstats</h1><div class="highlight"><pre>
<span class="sd"> &gt;&gt;&gt; _, probs = transition_matrix(a)</span>
<span class="sd"> &gt;&gt;&gt; # Start the plot</span>
<span class="sd"> &gt;&gt;&gt; grid_kws = {&quot;height_ratios&quot;: (.9, .05), &quot;hspace&quot;: .1}</span>
<span class="sd"> &gt;&gt;&gt; f, (ax, cbar_ax) = plt.subplots(2, gridspec_kw=grid_kws, figsize=(5, 5))</span>
<span class="sd"> &gt;&gt;&gt; sns.heatmap(probs, ax=ax, square=False, vmin=0, vmax=1, cbar=True, cbar_ax=cbar_ax,</span>
<span class="sd"> ... cmap=&#39;YlOrRd&#39;, annot=True, fmt=&#39;.2f&#39;,</span>
<span class="sd"> ... cbar_kws={&quot;orientation&quot;: &quot;horizontal&quot;, &#39;fraction&#39;: 0.1, &#39;label&#39;: &#39;Transition probability&#39;})</span>
<span class="sd"> &gt;&gt;&gt; f, (ax, cbar_ax) = plt.subplots(2, gridspec_kw=grid_kws,</span>
<span class="sd"> ... figsize=(5, 5))</span>
<span class="sd"> &gt;&gt;&gt; sns.heatmap(probs, ax=ax, square=False, vmin=0, vmax=1, cbar=True,</span>
<span class="sd"> ... cbar_ax=cbar_ax, cmap=&#39;YlOrRd&#39;, annot=True, fmt=&#39;.2f&#39;,</span>
<span class="sd"> ... cbar_kws={&quot;orientation&quot;: &quot;horizontal&quot;, &quot;fraction&quot;: 0.1,</span>
<span class="sd"> ... &quot;label&quot;: &quot;Transition probability&quot;})</span>
<span class="sd"> &gt;&gt;&gt; ax.set_xlabel(&quot;To sleep stage&quot;)</span>
<span class="sd"> &gt;&gt;&gt; ax.xaxis.tick_top()</span>
<span class="sd"> &gt;&gt;&gt; ax.set_ylabel(&quot;From sleep stage&quot;)</span>
Expand Down
10 changes: 6 additions & 4 deletions docs/build/html/generated/yasa-transition_matrix-1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
_, probs = transition_matrix(a)
# Start the plot
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'})
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")
Expand Down
10 changes: 6 additions & 4 deletions docs/build/html/generated/yasa.transition_matrix.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ <h1>yasa.transition_matrix</h1>
<span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="p">,</span> <span class="n">probs</span> <span class="o">=</span> <span class="n">transition_matrix</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># Start the plot</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">grid_kws</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;height_ratios&quot;</span><span class="p">:</span> <span class="p">(</span><span class="o">.</span><span class="mi">9</span><span class="p">,</span> <span class="o">.</span><span class="mi">05</span><span class="p">),</span> <span class="s2">&quot;hspace&quot;</span><span class="p">:</span> <span class="o">.</span><span class="mi">1</span><span class="p">}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="p">,</span> <span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">cbar_ax</span><span class="p">)</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">gridspec_kw</span><span class="o">=</span><span class="n">grid_kws</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sns</span><span class="o">.</span><span class="n">heatmap</span><span class="p">(</span><span class="n">probs</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">,</span> <span class="n">square</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">vmin</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">cbar</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">cbar_ax</span><span class="o">=</span><span class="n">cbar_ax</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">cmap</span><span class="o">=</span><span class="s1">&#39;YlOrRd&#39;</span><span class="p">,</span> <span class="n">annot</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;.2f&#39;</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">cbar_kws</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;orientation&quot;</span><span class="p">:</span> <span class="s2">&quot;horizontal&quot;</span><span class="p">,</span> <span class="s1">&#39;fraction&#39;</span><span class="p">:</span> <span class="mf">0.1</span><span class="p">,</span> <span class="s1">&#39;label&#39;</span><span class="p">:</span> <span class="s1">&#39;Transition probability&#39;</span><span class="p">})</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span><span class="p">,</span> <span class="p">(</span><span class="n">ax</span><span class="p">,</span> <span class="n">cbar_ax</span><span class="p">)</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">gridspec_kw</span><span class="o">=</span><span class="n">grid_kws</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sns</span><span class="o">.</span><span class="n">heatmap</span><span class="p">(</span><span class="n">probs</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">,</span> <span class="n">square</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">vmin</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">cbar</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">cbar_ax</span><span class="o">=</span><span class="n">cbar_ax</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="s1">&#39;YlOrRd&#39;</span><span class="p">,</span> <span class="n">annot</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;.2f&#39;</span><span class="p">,</span>
<span class="gp">... </span> <span class="n">cbar_kws</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;orientation&quot;</span><span class="p">:</span> <span class="s2">&quot;horizontal&quot;</span><span class="p">,</span> <span class="s2">&quot;fraction&quot;</span><span class="p">:</span> <span class="mf">0.1</span><span class="p">,</span>
<span class="gp">... </span> <span class="s2">&quot;label&quot;</span><span class="p">:</span> <span class="s2">&quot;Transition probability&quot;</span><span class="p">})</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ax</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s2">&quot;To sleep stage&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ax</span><span class="o">.</span><span class="n">xaxis</span><span class="o">.</span><span class="n">tick_top</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ax</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="s2">&quot;From sleep stage&quot;</span><span class="p">)</span>
Expand Down
10 changes: 6 additions & 4 deletions yasa/sleepstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ def transition_matrix(hypno):
>>> _, probs = transition_matrix(a)
>>> # Start the plot
>>> 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'})
>>> 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")
Expand Down

0 comments on commit 4a80b4b

Please sign in to comment.