python在窗体显示表格_pycharm中,matplotlib.pyplot.show()显示的图表,输出到sciview,怎么弹出来?...

1.问题:

和题目一样,pycharm中,matplotlib.pyplot.show()显示的图表,输出到sciview,怎么弹出来?

2.代码:

import matplotlib.pyplot as plt

import matplotlib.animation as animation

from matplotlib import style

style.use('fivethirtyeight')

fig = plt.figure(figsize=(9, 6))

ax1 = fig.add_subplot(1, 1, 1)

def animate(i):

graph_data = open('result.txt', 'r').read()

lines = graph_data.split('\n')

xs = []

ys = []

for line in lines:

if len(line) > 1:

x, y = line.split(' ')

xs.append(int(x))

ys.append(int(y))

ax1.clear()

ax1.plot(xs, ys)

ani = animation.FuncAnimation(fig, animate, interval=1000)

plt.show()

result.txt里面是数据,两列,中间空格,格式:

你可能感兴趣的:(python在窗体显示表格)