Matplotlib 1.5 usage of axes.prop_cycle

前端 未结 2 1836
孤城傲影
孤城傲影 2021-01-11 19:04

axes.color_cycle is deprecated in Matplotlib 1.5. However its usage was quite straightforward: we could easily grab a specific color by:

plt.rc         


        
2条回答
  •  花落未央
    2021-01-11 19:12

    To get the value you want:

    list(mpl.rcParams['axes.prop_cycle'])[1]['color'])
    

    There is an open PR to add a by_key method to Cycler objects so this will eventually be

    mpl.rcParams['axes.prop_cycle'].by_key()['color'][1]
    

    There are also some discussions about mapping the color 'c1' to the first color in the prop_cycle, but that has not been implemented yet.

    I am the main author of the cycler docs, what additional detail would you want to see there?

提交回复
热议问题