import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots()
ax.set_title('График')
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_xlim((-5, 5))
ax.set_ylim((-5, 5))
ax.grid()
x = np.linspace(-5, 5, 100)
y = x2 + np.cos(x) - x3
ax.plot(x, y)
plt.show()