Browse Source

Plot

pull/42/head
Jure Šorn 5 years ago
parent
commit
77c6779e92
2 changed files with 12 additions and 8 deletions
  1. 10
      README.md
  2. 10
      index.html

10
README.md

@ -2227,10 +2227,12 @@ Plot
```python ```python
# $ pip3 install matplotlib # $ pip3 install matplotlib
from matplotlib import pyplot from matplotlib import pyplot
pyplot.plot(<data_1> [, <data_2>, ...]) # Or: pyplot.hist(<data>)
pyplot.savefig(<filename>)
pyplot.show()
pyplot.clf() # Clears figure.
pyplot.plot(<y_data>)
pyplot.plot(<x_data>, <y_data>)
pyplot.plot(..., label=<str>) # Use `pyplot.legend()` to add legend.
pyplot.savefig(<filename>) # Saves figure.
pyplot.show() # Displays figure.
pyplot.clf() # Clears figure.
``` ```

10
index.html

@ -1925,10 +1925,12 @@ reader(adder(printer())) <span class="hljs-comment"># 100, 101, ..., 109</span>
<div><h2 id="plot"><a href="#plot" name="plot">#</a>Plot</h2><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install matplotlib</span> <div><h2 id="plot"><a href="#plot" name="plot">#</a>Plot</h2><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install matplotlib</span>
<span class="hljs-keyword">from</span> matplotlib <span class="hljs-keyword">import</span> pyplot <span class="hljs-keyword">from</span> matplotlib <span class="hljs-keyword">import</span> pyplot
pyplot.plot(&lt;data_1&gt; [, &lt;data_2&gt;, ...]) <span class="hljs-comment"># Or: pyplot.hist(&lt;data&gt;)</span>
pyplot.savefig(&lt;filename&gt;)
pyplot.show()
pyplot.clf() <span class="hljs-comment"># Clears figure.</span>
pyplot.plot(&lt;y_data&gt;)
pyplot.plot(&lt;x_data&gt;, &lt;y_data&gt;)
pyplot.plot(..., label=&lt;str&gt;) <span class="hljs-comment"># Use `pyplot.legend()` to add 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>
</code></pre></div> </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> <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>

Loading…
Cancel
Save