From 7c21cf8d690b1d88e015790bc87e9723dac0fd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 15 Sep 2019 23:00:03 +0200 Subject: [PATCH] Plot --- README.md | 31 +++++++++---------------------- index.html | 25 +++++++------------------ 2 files changed, 16 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 7c03ffd..f7f687b 100644 --- a/README.md +++ b/README.md @@ -1950,22 +1950,6 @@ Memory View .release() # Releases the buffer. ``` -```python - = [] # Returns int in range from 0 to 255. - = [] # Returns bytes even if it has only one element. -.write() -``` - -```python - = .join() # Joins elements using bytes object as separator. - = bytes() # Or: .tobytes() -'' = .hex() - = list() # Returns numbers. - = str(, 'utf-8') # Or: .decode('utf-8') - = int.from_bytes(, byteorder='big|little', signed=False) -'' = .hex() -``` - Deque ----- @@ -2257,12 +2241,15 @@ from matplotlib import pyplot ``` ```python -pyplot.plot() -pyplot.plot(, ) -pyplot.plot(..., label=) # Use `pyplot.legend()` to add legend. -pyplot.savefig() # Saves figure. -pyplot.show() # Displays figure. -pyplot.clf() # Clears figure. +pyplot.plot() # X values start from 0. +pyplot.plot(, ) # Add `label=` for legend. +``` + +```python +pyplot.legend() # Adds a legend. +pyplot.savefig() # Saves figure. +pyplot.show() # Displays figure. +pyplot.clf() # Clears figure. ``` diff --git a/index.html b/index.html index e4d2c6e..6509963 100644 --- a/index.html +++ b/index.html @@ -1729,18 +1729,6 @@ db = connector.connect(host=<str>, user=<str>, password=<str>, -
<num>   = <mview>[<index>]                # Returns int in range from 0 to 255.
-<mview> = <mview>[<slice>]                # Returns bytes even if it has only one element.
-<file>.write(<mview>)
-
-
<bytes> = <bytes>.join(<coll_of_mviews>)  # Joins elements using bytes object as separator.
-<bytes> = bytes(<mview>)                  # Or: <mview>.tobytes() 
-'<hex>' = <mview>.hex()
-<list>  = list(<mview>)                   # Returns numbers.
-<str>   = str(<mview>, 'utf-8')           # Or: <bytes>.decode('utf-8')
-<int>   = int.from_bytes(<mview>, byteorder='big|little', signed=False)
-'<hex>' = <bytes>.hex()
-

#Deque

A thread-safe list with efficient appends and pops from either side. Pronounced "deck".

from collections import deque
 <deque> = deque(<collection>, maxlen=None)
 
@@ -1950,12 +1938,13 @@ reader(adder(printer())) # 100, 101, ..., 109 from matplotlib import pyplot -
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.
+
pyplot.plot(<y_data>)                  # X values start from 0.
+pyplot.plot(<x_data>, <y_data>)        # Add `label=<str>` for legend.
+
+
pyplot.legend()                        # Adds a legend.
+pyplot.savefig(<filename>)             # Saves figure.
+pyplot.show()                          # Displays figure.
+pyplot.clf()                           # Clears figure.
 

#Table

Prints a CSV file as an ASCII table:

# $ pip3 install tabulate
 import csv, tabulate