Heres what I am attempting in matplotlib.pyplot
using jupyter qtconsole
as my interpreter:
In [1]: import matplotlib.pyplot as plt
In [2]: plt.plot([1,2,3])
Out[2]: [<matplotlib.lines.Line2D at 0x7ab5710>]
In [3]: plt.show()
plt.plot([4,5,6])
Out[4]: [<matplotlib.lines.Line2D at 0x7d8d5c0>]
In[5]: plt.show()
In[6]: plt.figure(1).show()
c:\python35\lib\site-packages\matplotlib\figure.py:403: UserWarning: matplotlib is currently using a non-GUI backend, so cannot show the figure
"matplotlib is currently using a non-GUI backend, "
Both In[3]
and In[5]
successfully output an inline plot of the data. In[6]
is my attempt at replotting the second figure. Unfortunately I am getting an error message about non-GUI back-end.
Ideally what I would like to do is first plot the data (eg using a script) and then modify the plot using the interpreter, replot it, see if I like the changes, modify some more, replot, etc. is this even possible using my setup above?
EDIT
There are two main differences with the supposed duplicate:
- OP in the other question is using
pylab
which is deprecated - There is no explanation in the other question regarding my last point. Ok so there is no figure to show... That explains why no figure is output. That doesn't answer the question though. How to get a simple functional interface where the user can modify an existing plot and replot it at will?