我想为Python中的plotly express绘图创建一个带有n颜色的colormap,它应该从一种颜色淡入另一种颜色。 所有默认颜色贴图只有10个离散值,但我正在寻找一个带有n>;10个离散值
>>> px.colors.sequential.Plasma_r
['#f0f921',
'#fdca26',
'#fb9f3a',
'#ed7953',
'#d8576b',
'#bd3786',
'#9c179e',
'#7201a8',
'#46039f',
'#0d0887']
有没有办法将连续贴图拆分为n个部分
如果你不介意rgb颜色,那么^{} 是一种选择。下面是一个在
'rgb(0, 0, 0)'
和'rgb(255, 255, 255)'
之间的灰度中有15种颜色的示例:这里有一个例子,在蓝色
'rgb(0, 0, 255)'
和红色'rgb(255, 0, 0)'
之间有25种颜色:完整代码:
相关问题 更多 >
编程相关推荐