Created
November 28, 2018 05:42
-
-
Save shunkino/ebf266ce0e316e27c26a159f5bd9a7cb to your computer and use it in GitHub Desktop.
Function to convert colorscale format. for my blog.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import colorlover as cl | |
def convert_colorscale_format(colorscale): | |
plotly_colorscale = [] | |
for index, sec_value in enumerate(np.linspace(0, 1, len(colorscale))): | |
plotly_colorscale.append([sec_value, colorscale[index]]) | |
return plotly_colorscale |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment