OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Python, matplotlib pyplot show() not blocking

  • Thread starter Thread starter scotlandhoy
  • Start date Start date
S

scotlandhoy

Guest
I'm having trouble with the show() function not blocking. I've taken over a python application from someone that left and I seem to remembering this worked on his (IT reclaimed) PC. Here's the code ...

Code:
import matplotlib.pyplot as plt

plt.title("Molding X Error")
plt.xlabel("X")
plt.ylabel("X Error")
plt.plot( ... details that work and not the problem ... )
plt.show(block=True)
        
plt.title("Molding Y Error")
plt.xlabel("Y")
plt.ylabel("Y Error")        
plt.plot( ... details that work and not the problem ... )
plt.show(block=True)

On the other guys PC, the first show() would display appropriately. After dismissing the first, the second would display.

I run it, and it not only doesn't stop on the first show(), it combines data from both the first and second with the title and labels from the second.

I step through with the debugger, and the first does show, but stepping to the second the same result is seen.

Windows 7 Pro 64-bit. Python2.7.10, Anaconda 2.3.0 which contains (apparently) matplotlib1.4.3

Note: I did read through "(python) matplotlib pyplot show() .. blocking or not?" where it was from 2011 and was referring to matplotlib1.0.1 as a solution.
<p>I'm having trouble with the <code>show()</code> function not blocking. I've taken over a python application from someone that left and I seem to remembering this worked on his (IT reclaimed) PC.
Here's the code ...</p>
<pre><code>import matplotlib.pyplot as plt

plt.title("Molding X Error")
plt.xlabel("X")
plt.ylabel("X Error")
plt.plot( ... details that work and not the problem ... )
plt.show(block=True)

plt.title("Molding Y Error")
plt.xlabel("Y")
plt.ylabel("Y Error")
plt.plot( ... details that work and not the problem ... )
plt.show(block=True)
</code></pre>
<p>On the other guys PC, the first <code>show()</code> would display appropriately.
After dismissing the first, the second would display.</p>
<p>I run it, and it not only doesn't stop on the first <code>show()</code>, it combines data from both the first and second with the title and labels from the second.</p>
<p>I step through with the debugger, and the first does show, but stepping to the second the same result is seen.</p>
<p>Windows 7 Pro 64-bit.
Python2.7.10, Anaconda 2.3.0 which contains (apparently) matplotlib1.4.3</p>
<p>Note: I did read through "(python) matplotlib pyplot show() .. blocking or not?" where it was from 2011 and was referring to matplotlib1.0.1 as a solution.</p>
 
Top