R
Try this:import matplotlib.pyplot as plt
from matplotlib.widgets import RadioButtons
x = [80, 85, 90, 95, 100, 105]
s0 = [30, 22.5, 15, 7.5, 0, -7.5]
s1 = [0, 21.5, 4, 6.5, -1, -8.5]
s2 = [1, 23.5, 16, 8.5, 1, 6.5]
fig, ax = plt.subplots(2) # +++ 2
plt.subplots_adjust(left=0.3)
rax = plt.axes([0.05, 0.7, 0.15, 0.15], facecolor='yellow')
radio = RadioButtons(rax, ('1-я', '2-я', '3-я'))
def hzfunc(label):
ax[1].clear()
if label == "2-я":
ax[1].plot(x, s1, lw=2, color='blue')
ax[1].set_title("2-я")
elif label == "3-я":
ax[1].plot(x, s2, lw=2, color='green')
ax[1].set_title("3-я")
elif label == "1-я":
ax[1].axis('off')
plt.draw()
radio.on_clicked(hzfunc)
ax[0].plot(x, s0, lw=2, color='red')
ax[0].set_title("1-я")
ax[1].axis('off')
plt.show()