# Random data
xyz = np.random.randint(0, 100, (21, 3003))
df = pd.DataFrame(xyz).rename(columns = {i: f'x_{i}' if i <= 1000 else f'y_{i-1001}' if i <= 2001 else f'z_{i-2002}' for i in range(3003)})
# Plotting begins here
plt.figure()
for row in range(21):
x, y = [[df.at[row, f'{x}_{i}'] for i in range(1001)] for x in ['x', 'y']]
plt.plot(x, y)
1条答案
按热度按时间ulydmbyx1#
我假设你要画21个线图,x列代表x坐标,y列代表y坐标,我将生成我自己的一组随机数据来演示这个脚本。