import matplotlib.pyplot as plt
import numpy as np
# PrvĂ˝ graf: y = x^2 + 2x + 1 v intervale <-5, 5>
x1 = np.linspace(-5, 5, 400)
y1 = x1 ** 2 + 2 * x1 + 1
plt.figure(figsize=(10, 5))
plt.subplot(1, 2, 1)
plt.plot(x1, y1, label='y = x^2 + 2x + 1', color='blue')
plt.title('Graf funkcie y = x^2 + 2x + 1')
plt.grid(True)
x2 = np.linspace(0, 2 * np.pi, 400)
y2 = np.sin(x2)
plt.subplot(1, 2, 2)
plt.plot(x2, y2, label='y = sin(x)', color='red')
plt.title('Graf funkcie y = sin(x)')
plt.grid(True)
plt.tight_layout()
plt.show()