Matplotlib plots not displaying in sublimetext

前端 未结 5 2197
情话喂你
情话喂你 2020-12-09 04:30

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

5条回答
  •  被撕碎了的回忆
    2020-12-09 05:28

    Note in sublime text 3 (with anaconda package installed)

    You need to add a custom build system as theta said, by:

    first add a folder named python in \path\to\Sublime Text Build XXXX\Data\Packages

    then put a file named python.sublime-build into that folder.

    {
        "cmd": ["python", "-u", "$file"],
        "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
        "selector": "source.python",
        "shell": true
    }
    

    and remember to add plt.show() like Roald said.

    plt.imshow(image)
    plt.show()
    

    Demo:

提交回复
热议问题