Run python script in IPython with inline / embedded plots

后端 未结 2 1345
天命终不由人
天命终不由人 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:16

    Greg answered it here:
    Start ipython qtconsole as interactive interpreter after script execution

    It works using the -m flag

    ipython qtconsole --matplotlib inline -m example_plots
    

    or

    ipython qtconsole --pylab inline -m example_plots
    

    But I do not know, what makes the difference between those two options pylab inline and matplotlib inline. From here I figure, that I'd rather use --matplotlib inline

    Even adding the file ending it does what I want to, but it complains about unknown failure after execution.

    pyplot.show(block=True) will give and unknown failure, too

提交回复
热议问题