Вы можете использовать plt.fill
, чтобы указать область графика для тени. Вы также можете использовать plt.text
для аннотирования разделов. Вот пример этого для графика, не слишком отличающегося от вашего (симметрия c вокруг оси y и ограничена сверху на 1 и ниже на 0):
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-np.pi, np.pi, num=100)
fig, ax = plt.subplots(1, 1)
ax.plot(x, np.abs(np.sin(x)))
# Get the left and right extent of the area to shade
LHS, RHS = ax.get_xlim()
# Specify the area to shade as the corners of the square we're interested in
ax.fill([0, RHS, RHS, 0], [0, 0, 1, 1], c='C1', alpha=0.3)
ax.fill([0, LHS, LHS, 0], [0, 0, 1, 1], c='C2', alpha=0.3)
ax.text(-np.pi/2, 0.4, '$x < 0$')
ax.text(np.pi/2, 0.4, '$x > 0$')
![enter image description here](https://i.stack.imgur.com/FCB45.png)