我尝试使用jupyter_client获取matplotlib输出并将其显示在我的Web应用程序中。这就是我的所作所为。但是io.stdout只是一个字符串。如何获取matplotlib的实际图像数据。感谢
In [6]: with capture_output() as io:
...: reply = kc.execute_interactive("import matplotlib.pyplot as plt\n%matplotlib inline\ndata=[1,1,2,3,4]\nplt.figure()\nplt.plot(data)", timeout=TI
...: MEOUT)
...:
...:
In [8]: io.stdout
Out[8]: '[<matplotlib.lines.Line2D at 0x1086a8d30>]<matplotlib.figure.Figure at 0x106f220f0>'