Skip to content

Commit 77c6779

Browse files
committed
Plot
1 parent 5172441 commit 77c6779

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,10 +2227,12 @@ Plot
22272227
```python
22282228
# $ pip3 install matplotlib
22292229
from matplotlib import pyplot
2230-
pyplot.plot(<data_1> [, <data_2>, ...]) # Or: pyplot.hist(<data>)
2231-
pyplot.savefig(<filename>)
2232-
pyplot.show()
2233-
pyplot.clf() # Clears figure.
2230+
pyplot.plot(<y_data>)
2231+
pyplot.plot(<x_data>, <y_data>)
2232+
pyplot.plot(..., label=<str>) # Use `pyplot.legend()` to add legend.
2233+
pyplot.savefig(<filename>) # Saves figure.
2234+
pyplot.show() # Displays figure.
2235+
pyplot.clf() # Clears figure.
22342236
```
22352237

22362238

index.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,10 +1925,12 @@
19251925

19261926
<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>
19271927
<span class="hljs-keyword">from</span> matplotlib <span class="hljs-keyword">import</span> pyplot
1928-
pyplot.plot(&lt;data_1&gt; [, &lt;data_2&gt;, ...]) <span class="hljs-comment"># Or: pyplot.hist(&lt;data&gt;)</span>
1929-
pyplot.savefig(&lt;filename&gt;)
1930-
pyplot.show()
1931-
pyplot.clf() <span class="hljs-comment"># Clears figure.</span>
1928+
pyplot.plot(&lt;y_data&gt;)
1929+
pyplot.plot(&lt;x_data&gt;, &lt;y_data&gt;)
1930+
pyplot.plot(..., label=&lt;str&gt;) <span class="hljs-comment"># Use `pyplot.legend()` to add legend.</span>
1931+
pyplot.savefig(&lt;filename&gt;) <span class="hljs-comment"># Saves figure.</span>
1932+
pyplot.show() <span class="hljs-comment"># Displays figure.</span>
1933+
pyplot.clf() <span class="hljs-comment"># Clears figure.</span>
19321934
</code></pre></div>
19331935

19341936
<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>

0 commit comments

Comments
 (0)