Написание while True
не очень хорошая идея.Я реорганизовал ваш код так, чтобы он дал мне следующий результат, возможно, он будет вам полезен.
Результат:

Код:
import math
import matplotlib.pyplot as plt
x = []
y = []
i = 0
fig = plt.figure()
ax = fig.add_subplot(111)
fig.show()
for _ in range(11):
x.append(i)
y.append(math.sin(i))
i += 1
ax.plot(x, y, color='red')
fig.canvas.draw()
ax.set_xlim(left=0, right=10)
ax.set_ylim(bottom=-1.5, top=1.5)
Есть много мест, где можно улучшить код и результат, но вы можете начать с него.