One way to do what (I think) you ask for is to use ipython. ipython is an interactive python environment which comes with many python distributions.
A quick example:
In a cmd, type >>> ipython
, which will load the ipython terminal. In ipython, type:
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
ax.plot([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], 'r-')
fig.show()
Now you have a figure, at the same time as the ipython terminal is "free". This means that you can do commands to the figure, like ax.set_xlabel('XLABEL')
, or ax.set_yticks([0, 5])
. To make it show on screen, you need to redraw the canvas, which is done by calling fig.canvas.draw()
.
Note that with ipython, you have full tab-completion with all functions to all objects! Typing fig.get_
and then tab gives you the full list of functions beginning with fig.get_, this is extremely helpful!
Also note that you can run python-scripts in ipython, with run SCRIPT.py
in the ipython-cmd, and at the same time having access to all variables defined in the script. They can then be used as above.
Hope this helps!