How to get Plotly.js default colors list?

后端 未结 5 1770
陌清茗
陌清茗 2020-12-08 20:48

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.

5条回答
  •  孤街浪徒
    2020-12-08 21:18

    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.

提交回复
热议问题