I’ve recently started using sublimetext 2, however I noticed today that the plt.show() function doesn’t seem to work when run within sublimetext.
If for example I create the following script:
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.show()
Running this with IDLE generates a plot, however using sublimetext no output is generated. It just keeps ‘thinking’ until I end the python.exe process after which [Finished] is output.
Have I misunderstood how sublimetext is meant to be used?
Thanks.
My guess would be that Sublime Text 2 launches your code in its own environment, and only traps and displays the console output. The same problem exists when using GUI’s, such as wxPython.
Another work around is to open the command prompt and launch it manually (python file.py).
EDIT: Here it states that “Under Windows, GUIs are supressed.”
EDIT 2: Here it lists a way to fix it, right at the bottom of the page.