Home > OS >  How to make colormap of this colorbar image attached?
How to make colormap of this colorbar image attached?

Time:04-13

enter image description here

0

I want to make a colormap used in the attached image.

 img = imread('/path/Screenshot 2022-04-12 at 2.14.16 PM.png')
 colors_from_img = img[:, 0, :]
 my_cmap = LinearSegmentedColormap.from_list('my_cmap', colors_from_img, N=651)
 y = random_sample((100, 100))
 imshow(y, cmap=my_cmap);plt.colorbar().png')

Looking forward to your inputs

CodePudding user response:

If you want only the color bar to be an image, I would suggest the tutorial in the formula for an enter image description here

CodePudding user response:

You just have to transpose the strategy linked in my comment from vertical to horizontal. To avoid random guessing, you analyze first the image dimensions, then guesstimate what level the horizontal line should be (ca 66/3) and what the step for the color bars is (ca 616/11). Finally, you have to enter image description here

  • Related