聚类:如何更改图形的颜色

时间:2020-09-26 19:53:18

标签: python time-series cluster-analysis graph-visualization

我编写了以下代码以可视化时间序列聚类。

for yi in range(6):
            plt.subplot(6, 1, 1 + yi)
            for xx in stack_data[y_pred6 == yi]:
                plt.plot(xx.ravel(), "k-", alpha=.2)e
    
    plt.tight_layout()
    plt.show()

image clustering

我使用的数据是33维NumPy数组,如下所示。

In:stack_data.shape
out:(33, 3277, 1)

在每张图上,我要为前14个数组添加一个红色:即stack_data[0:13]。 接下来的17个数组为蓝色:stack_data[14:32]

我们可能会发现在数组上添加标签的一些线索,但是请告诉我您的想法。 谢谢。

0 个答案:

没有答案