<jupyter_start><jupyter_text>title: "[Python] MatplotLib"  categories:      - studytags:      - GitHub      - Jekyll      - JupyterLab      - Matplotlib---<jupyter_code>import matplotlib.pyplot as plt
import numpy as np



plt.plot([1,2,3,4])
plt.plot([1,2,3,4], [1,4,9,16])
plt.axis([0,6,0,20])
t = np.arange(0, 5., 0.2)

plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')
n = 20
x = np.random.rand(n)
y = np.random.rand(n)

plt.scatter(x, y, s=100, c='#a37ff1', marker='D')
np.random.seed(1)
n = 20
x = np.random.rand(n)
y = np.random.rand(n)

plt.plot(x, y, 'D', c='#a37ff1', markersize=10)
np.random.seed(1)
n = 20
x = np.random.rand(n)
y = np.random.rand(n)

plt.scatter(x, y, s=100, c='#a37ff1', marker='D')
np.random.seed(19680801)

n = 50
x = np.random.rand(n)
y = np.random.rand(n)
colors = np.random.rand(n)
area = (30 * np.random.rand(n))**2

plt.scatter(x, y, s=area, c=colors, alpha=0.5)
ind = np.arange(4)

y = [4,6,5,8]
plt.bar(ind, y, width=0.3, bottom=5)
n = 5
menMeans = (20, 35, 30, 35, 27)
womenMeans = (25, 32, 34, 20, 27)

ind = np.arange(n)
width = 0.35

p1 = plt.bar(ind-width/2, menMeans, width, color='#d62728')
p2 = plt.bar(ind+width/2, womenMeans, width)

plt.ylabel('Scores')
plt.title('Scores by group and gender')
plt.xticks(ind, ('G1', 'G2', 'G3', 'G4', 'G5'))
plt.yticks(np.arange(0, 81, 10))
plt.legend((p1, p2), ('Men', 'Women'))
lables = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = 15, 30, 45, 10
explode = 0, 0.1, 0, 0

%matplotlib inline
plt.pie(sizes, explode=explode, labels=lables, autopct='%1.1f%%',
       shadow=True, startangle=90)
plt.axis('equal')
plt.legend()
v = np.random.uniform(0., 10., 4)
plt.uniform(v)
plt.subplot()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.23040659988214496, 'fraction_numerical': 0.08131997642899234, 'mean_word_length': 4.192660550458716, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '572804', 'license': 'MIT', 'n_tokens_mistral': 912, 'n_tokens_neox': 812, 'n_words': 170, 'path': '_ipynbs/2019-08-05-study-py-matplotlib.ipynb', 'repo_name': 'bboktori/bboktori.github.io', 'size': '1697'}