How to get Plotly.js default colors list?

Sushil Kumar picture Sushil Kumar · Nov 18, 2016 · Viewed 21.5k times · Source

I am plotting a plotly bubble chart on a webpage.. I want to get the list of default colors, plotly uses to draw the bubbles.

Answer

KDD picture KDD · Jun 23, 2017

According to the source code of Plotly.js (src/components/color/attributes.js), the default color list is

    '#1f77b4',  // muted blue
    '#ff7f0e',  // safety orange
    '#2ca02c',  // cooked asparagus green
    '#d62728',  // brick red
    '#9467bd',  // muted purple
    '#8c564b',  // chestnut brown
    '#e377c2',  // raspberry yogurt pink
    '#7f7f7f',  // middle gray
    '#bcbd22',  // curry yellow-green
    '#17becf'   // blue-teal

If you have more than 10 series, you will go back to the first color.