Hello,all
I have a problem with matplotlib. The numpy and matplotlib versions are all the newest versions
First,if I want to plot a figure,I can type several command,finally use the show() command,everything seems well,but I have to use the Ctrl+c to stop the show() to go further.
And I know I can use the interactive mode.So first I use ion(),then use the plot command to plot figure and draw() command to update the figure,but in this case ,the figure toolbar is not visible on the figure and I can not use it.However if I run the show() command then the figure toolbar appear and I can control the figure using the toolbar.
I wonder whether I can take advantage of the figure toolbar and the command line at the same time or not ?
Best wishes.
Hello,
I'm not sure if there is a nicer way to do what you want and I understand
correctly what you want to do, but as a workaround I would recommand you the
following:
use the mainloop-mode after show and an event to rearch a function, which
includes a "raw_input" to input text from the shell like
import pylab
def myfunc(event):
txt = raw_input(" input a string : ")
print "The string >%s< was recognized and will be executed" % (txt)
exec(txt)
pylab.draw()
pylab.figure()
pylab.axes()
pylab.connect("key_press_event", myfunc)
# call "myfunc" after a key press event
pylab.show()
you can end the mainloop by closing the figure.
best regards
Matthias
···
On Sunday 02 March 2008 13:31, linzhenhua wrote:
Hello,all
I have a problem with matplotlib. The numpy and matplotlib versions
are all the newest versions. First,if I want to plot a figure,I can type
several command,finally use the show() command,everything seems well,but I
have to use the Ctrl+c to stop the show() to go further. And I know I can
use the interactive mode.So first I use ion(),then use the plot command to
plot figure and draw() command to update the figure,but in this case ,the
figure toolbar is not visible on the figure and I can not use it.However if
I run the show() command then the figure toolbar appear and I can control
the figure using the toolbar. I wonder whether I can take advantage of the
figure toolbar and the command line at the same time or not ? Best wishes.