假设您有一个像这样的3D阵列:
[[['1', '1'], ['1', '2'], ['1', '3']],
[['3', '1'], ['3', '2'], ['3', '3']],
[['2', '1'], ['2', '2'], ['2', '3'], ['2', '4'], ['2', '5']]]
每个2D数组是一行的x,y坐标。 3D数组是数据集中线的汇编。如何将每个2D阵列与整个阵列分开绘制?换句话说,如何绘制一条坐标为(1,1),(1,2,,1,3)和另一条线(3,1),(3,2),(3,3)和等等吗?
答案 0 :(得分:0)
import matplotlib.pyplot as plt
plt.plot([val1[0] for val1 in lst_source[0] ], [val1[1] for val1 in lst_source[0] ])
plt.plot([val1[0] for val1 in lst_source[1] ], [val1[1] for val1 in lst_source[1] ])