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.
In the current versions of the IPython notebook and jupyter notebook, it is not necessary to use the %matplotlib inline function. As, whether you call matplotlib. pyplot. show() function or not, the graph output will be displayed in any case.
Download the “Install Matplotlib (for Mac)” file from my web site, and double-click it to run it. Test your installation. Start IDLE, type “import matplotlib”, and confirm that this command completes without an error.
Plotting from an IPython shell Using plt. show() in Matplotlib mode is not required.
More appropriate way is to just add one line in default Python build system file:
"shell": true
Or make additional Python build system with:
{
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"shell": true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With