Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

After these instructions in the Python interpreter one gets a window with a plot:

from matplotlib.pyplot 

import * plot([1,2,3]) 

show() 

# other code

Unfortunately, I don't know how to continue to interactively explore the figure created by show() while the program does further calculations.

Is it possible at all? Sometimes calculations are long and it would help if they would proceed during the examination of intermediate results.

1 Answer

0 votes
by (106k points)

Yes, they're many ways to detach matplotlib plots so that the computation can continue you can do it by using  matplotlib's calls that won't block:

from matplotlib.pyplot 

import plot, draw, show 

plot([1,2,3]) 

draw() 

print 'continue computation' 

Related questions

0 votes
1 answer
asked Oct 9, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 31, 2019 in Data Science by sourav (17.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...