Browse Source

Plot comments

pull/46/head
Jure Šorn 5 years ago
parent
commit
498bbd3ce9
2 changed files with 12 additions and 12 deletions
  1. 12
      README.md
  2. 12
      index.html

12
README.md

@ -2274,10 +2274,10 @@ Plot
from matplotlib import pyplot
pyplot.plot(<y_data> [, label=<str>])
pyplot.plot(<x_data>, <y_data>)
pyplot.legend() # Adds legend.
pyplot.savefig(<filename>) # Saves figure.
pyplot.show() # Displays figure.
pyplot.clf() # Clears figure.
pyplot.legend() # Adds a legend.
pyplot.savefig(<filename>) # Saves the figure.
pyplot.show() # Displays the figure.
pyplot.clf() # Clears the figure.
```
@ -2306,8 +2306,8 @@ def main():
wrapper(draw)
def draw(screen):
curs_set(0) # Makes cursor invisible.
screen.nodelay(True) # Makes getch() non-blocking.
curs_set(0) # Makes cursor invisible.
screen.nodelay(True) # Makes getch() non-blocking.
screen.clear()
screen.addstr(0, 0, 'Press ESC to quit.')
while screen.getch() != ascii.ESC:

12
index.html

@ -1962,10 +1962,10 @@ ValueError: malformed node or string
<span class="hljs-keyword">from</span> matplotlib <span class="hljs-keyword">import</span> pyplot
pyplot.plot(&lt;y_data&gt; [, label=&lt;str&gt;])
pyplot.plot(&lt;x_data&gt;, &lt;y_data&gt;)
pyplot.legend() <span class="hljs-comment"># Adds legend.</span>
pyplot.savefig(&lt;filename&gt;) <span class="hljs-comment"># Saves figure.</span>
pyplot.show() <span class="hljs-comment"># Displays figure.</span>
pyplot.clf() <span class="hljs-comment"># Clears figure.</span>
pyplot.legend() <span class="hljs-comment"># Adds a legend.</span>
pyplot.savefig(&lt;filename&gt;) <span class="hljs-comment"># Saves the figure.</span>
pyplot.show() <span class="hljs-comment"># Displays the figure.</span>
pyplot.clf() <span class="hljs-comment"># Clears the figure.</span>
</code></pre></div>
<div><h2 id="table"><a href="#table" name="table">#</a>Table</h2><div><h4 id="printsacsvfileasanasciitable">Prints a CSV file as an ASCII table:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install tabulate</span>
@ -1985,8 +1985,8 @@ pyplot.clf() <span class="hljs-comment"># Clears figur
wrapper(draw)
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">draw</span><span class="hljs-params">(screen)</span>:</span>
curs_set(<span class="hljs-number">0</span>) <span class="hljs-comment"># Makes cursor invisible.</span>
screen.nodelay(<span class="hljs-keyword">True</span>) <span class="hljs-comment"># Makes getch() non-blocking.</span>
curs_set(<span class="hljs-number">0</span>) <span class="hljs-comment"># Makes cursor invisible.</span>
screen.nodelay(<span class="hljs-keyword">True</span>) <span class="hljs-comment"># Makes getch() non-blocking.</span>
screen.clear()
screen.addstr(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-string">'Press ESC to quit.'</span>)
<span class="hljs-keyword">while</span> screen.getch() != ascii.ESC:

Loading…
Cancel
Save