How to set same color for markers and lines in a matplotlib plot loop?

后端 未结 3 1430
孤城傲影
孤城傲影 2021-02-05 05:52

I have to plot multiple lines and markers with matplotlib by creating a loop and I have already set the axes color cycle in the matplolibrc param file. In each cycle of the loop

3条回答
  •  野的像风
    2021-02-05 06:20

    Note that iter.next() was removed in Python 3.x as described in this question. If you run the examples in the accepted answer you will therefore receive AttributeError:

    'itertools.cycle' object has no attribute 'next'
    

    For both examples this can be solved by replacing:

    marker=marker.next()
    

    in plt.plot() with

    marker=next(marker)
    

提交回复
热议问题