3

Pandas plot with multiple graphs has this standard colors (the first four colors are shown here):

enter image description here

How can I get programmatically these four colors and the following ones?

Alessandro Jacopson
  • 18,047
  • 15
  • 98
  • 153

1 Answers1

6

You are referring to category10 color palette:

enter image description here

Programmatically you can access them through:

import matplotlib.pyplot as plt
plt.rcParams['axes.prop_cycle'].by_key()['color']
['#1f77b4',
 '#ff7f0e',
 '#2ca02c',
 '#d62728',
 '#9467bd',
 '#8c564b',
 '#e377c2',
 '#7f7f7f',
 '#bcbd22',
 '#17becf']

See this page of the matplotlib docs or this SO question for more info.

gosuto
  • 5,422
  • 6
  • 36
  • 57