How to pick a new color for each plotted line within a figure in matplotlib?

前端 未结 7 706
日久生厌
日久生厌 2020-11-27 11:06

I\'d like to NOT specify a color for each plotted line, and have each line get a distinct color. But if I run:

from matplotlib import pyplot as plt
for i in          


        
7条回答
  •  庸人自扰
    2020-11-27 11:33

    matplotlib 1.5+

    You can use axes.set_prop_cycle (example).

    matplotlib 1.0-1.4

    You can use axes.set_color_cycle (example).

    matplotlib 0.x

    You can use Axes.set_default_color_cycle.

提交回复
热议问题