unique plot marker for each plot in matplotlib

前端 未结 5 2096
走了就别回头了
走了就别回头了 2021-01-03 18:04

I have a loop where i create some plots and I need unique marker for each plot. I think about creating function, which returns random symbol, and use it in my program in thi

5条回答
  •  醉梦人生
    2021-01-03 18:47

    import matplotlib.pyplot as plt
    fig = plt.figure()
    markers=['^', 's', 'p', 'h', '8']
    for i in range(5):
        plt.plot(x[i], y[i], c='green', marker=markers[i])
        plt.xlabel('X Label')
        plt.ylabel('Y Label') 
    plt.show()
    

提交回复
热议问题