0

I am executing a script on spyder4, I want to either update old plots or add new figures depending on the state of %matplotlib something like this:

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([3,5])
if %matplotlib == qt:
    ax.set_data([],[])
else:
    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.plot([5,6]

Is there a way to get the current value of %matplotlib, whether it is set as qt or inline?

kksagar
  • 267
  • 1
  • 3
  • 14

0 Answers0