i am having issues with matplotlib animations when using xlwings, example from matplotlib:
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.animation as animation
import xlwings as xw
fig, ax = plt.subplots()
x = np.arange(0, 2*np.pi, 0.01)
line, = ax.plot(x, np.sin(x))
def animate(i):
line.set_ydata(np.sin(x + i / 50)) # update the data.
return line,
ani = animation.FuncAnimation(
fig, animate, interval=20, blit=True, save_count=50)
plt.show()
i get the following error:
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
this works fine when i do not use xlwings