# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import matplotlib
from matplotlib import pyplot as plt
import numpy as np

# ## Задание 1

fig, ax = plt.subplots()
rect = matplotlib.patches.Rectangle((-1, -1), 2, 2)
ax.add_patch(rect)
plt.axis([-2, 2, -1.5, 1.5])
plt.show()

# ## Задание 2

x = np.arange(0, 10, 0.2)
y = np.sin(x)
plt.scatter(x, y)
plt.xlabel('x')
plt.ylabel('y')
plt.show()

# ## Задание 3

# +
np.random.seed(4)


lam = 1.5
pois_dist = np.random.poisson(1.5, 10001)
plt.hist(pois_dist, max(pois_dist), density=1, facecolor='g', alpha=0.75)

x = np.arange(min(pois_dist), max(pois_dist))
y = [((lam**i * np.exp(-lam)) / np.math.factorial(i)) for i in x]
plt.plot(x, y, '--')
# -



StarcoderdataJupyterScriptsDedupFiltered