Run python script in IPython with inline / embedded plots

后端 未结 2 1307
天命终不由人
天命终不由人 2021-02-13 15:54

I\'d like to have a batch file in one folder with a python script. The batch file should call the script in IPython and plot the figures inline / embed

2条回答
  •  佛祖请我去吃肉
    2021-02-13 16:18

    How to run a python script with IPython, showing plots embedded?

    • You need to use the qt console.
    • Run ipython qtconsole .
    • If you have jupyter installed, the better.
    • Run jupyter qtconsole

    Do I need to use pylab or can I just import matplotlib.pyplot in the script?

    • Run %matplotlib inline prior to importing matplotlib.pyplot.

    Is %pylab inline / %matplotlib inline to be used or not?

    • Yes. But pylab has been depreciated. Use %matplotlib inline.

提交回复
热议问题